//http://tb1.bdstatic.com/??/tb/_/rsa_safe_299a966.js,/tb/_/paykey_safe_payment_37d2c7b.js,/tb/_/captcha_57d747c.js,/tb/_/captcha_dialog_ceaacd2.js,/tb/_/captcha_safe_payment_7f700b4.js,/tb/_/mobile_safe_payment_5c23e71.js,/tb/_/tbean_safe_3668241.js,/tb/_/qianbao_purchase_tdou_81a2c40.js,/tb/_/payment_dialog_title_3e773b9.js,/tb/_/tdou_get_dff18fa.js,/tb/_/tbean_safe_ajax_5dbae2e.js,/tb/_/tdou_data_747c462.js,/tb/_/umoney_1379f71.js,/tb/_/tdou_template_8d6b3f6.js,/tb/_/tdou_builder_05101dd.js,/tb/_/tdou_view_operation_bootstrap_7f5fd6b.js,/tb/_/tdou_view_cashier_6afe462.js,/tb/_/tdou_view_util_d282db0.js,/tb/_/tdou_view_auto_redirect_c5d928c.js,/tb/_/umoney_query_e6ef23a.js,/tb/_/tdou_view_check_f11908d.js,/tb/_/tdou_counter_cbe5c8a.js,/tb/_/tdou_view_fec0b7b.js,/tb/_/tdou_3289666.js,/tb/_/tcharge_dialog_1cd4f09.js
//输入框

! function() {
	PUBKEY = {}, _.Module.define({
		path: "encourage-payment/widget/rsa_safe",
		requires: [],
		sub: {
			RSA: {},
			publicKey: "",
			setKey: function() {
				this.publicKey = pkey
			},
			getKey: function() {
				var t = this;
				$.ajax({
					url: "/tbmall/pass/getpubkey",
					type: "get",
					dataType: "json",
					success: function(e) {
						PUBKEY.publicKey = e.data.pubkey, t.publicKey = PUBKEY.publicKey
					}
				})
			},
			vcode: function(t) {
				var e = new this.RSA;
				return e.setKey(this.publicKey), encodeURIComponent(e.encrypt(t))
			},
			initial: function(t) {
				var e = this,
					i = $.extend({}, t);
				PUBKEY.publicKey || i.publicKey ? this.publicKey = PUBKEY.publicKey : this.getKey(),
					function(t) {
						function e(t, e, i) {
							null != t && ("number" == typeof t ? this.fromNumber(t, e, i) : null == e && "string" != typeof t ? this.fromString(t, 256) : this.fromString(t, e))
						}

						function i() {
							return new e(null)
						}

						function r(t, e, i, r, s, n) {
							for(; --n >= 0;) {
								var o = e * this[t++] + i[r] + s;
								s = Math.floor(o / 67108864), i[r++] = 67108863 & o
							}
							return s
						}

						function s(t, e, i, r, s, n) {
							for(var o = 32767 & e, h = e >> 15; --n >= 0;) {
								var a = 32767 & this[t],
									u = this[t++] >> 15,
									c = h * a + u * o;
								a = o * a + ((32767 & c) << 15) + i[r] + (1073741823 & s), s = (a >>> 30) + (c >>> 15) + h * u + (s >>> 30), i[r++] = 1073741823 & a
							}
							return s
						}

						function n(t, e, i, r, s, n) {
							for(var o = 16383 & e, h = e >> 14; --n >= 0;) {
								var a = 16383 & this[t],
									u = this[t++] >> 14,
									c = h * a + u * o;
								a = o * a + ((16383 & c) << 14) + i[r] + s, s = (a >> 28) + (c >> 14) + h * u, i[r++] = 268435455 & a
							}
							return s
						}

						function o(t) {
							return Ui.charAt(t)
						}

						function h(t, e) {
							var i = Oi[t.charCodeAt(e)];
							return null == i ? -1 : i
						}

						function a(t) {
							for(var e = this.t - 1; e >= 0; --e) t[e] = this[e];
							t.t = this.t, t.s = this.s
						}

						function u(t) {
							this.t = 1, this.s = 0 > t ? -1 : 0, t > 0 ? this[0] = t : -1 > t ? this[0] = t + DV : this.t = 0
						}

						function c(t) {
							var e = i();
							return e.fromInt(t), e
						}

						function f(t, i) {
							var r;
							if(16 == i) r = 4;
							else if(8 == i) r = 3;
							else if(256 == i) r = 8;
							else if(2 == i) r = 1;
							else if(32 == i) r = 5;
							else {
								if(4 != i) return this.fromRadix(t, i), void 0;
								r = 2
							}
							this.t = 0, this.s = 0;
							for(var s = t.length, n = !1, o = 0; --s >= 0;) {
								var a = 8 == r ? 255 & t[s] : h(t, s);
								0 > a ? "-" == t.charAt(s) && (n = !0) : (n = !1, 0 == o ? this[this.t++] = a : o + r > this.DB ? (this[this.t - 1] |= (a & (1 << this.DB - o) - 1) << o, this[this.t++] = a >> this.DB - o) : this[this.t - 1] |= a << o, o += r, o >= this.DB && (o -= this.DB))
							}
							8 == r && 0 != (128 & t[0]) && (this.s = -1, o > 0 && (this[this.t - 1] |= (1 << this.DB - o) - 1 << o)), this.clamp(), n && e.ZERO.subTo(this, this)
						}

						function p() {
							for(var t = this.s & this.DM; this.t > 0 && this[this.t - 1] == t;) --this.t
						}

						function l(t) {
							if(this.s < 0) return "-" + this.negate().toString(t);
							var e;
							if(16 == t) e = 4;
							else if(8 == t) e = 3;
							else if(2 == t) e = 1;
							else if(32 == t) e = 5;
							else {
								if(4 != t) return this.toRadix(t);
								e = 2
							}
							var i, r = (1 << e) - 1,
								s = !1,
								n = "",
								h = this.t,
								a = this.DB - h * this.DB % e;
							if(h-- > 0)
								for(a < this.DB && (i = this[h] >> a) > 0 && (s = !0, n = o(i)); h >= 0;) e > a ? (i = (this[h] & (1 << a) - 1) << e - a, i |= this[--h] >> (a += this.DB - e)) : (i = this[h] >> (a -= e) & r, 0 >= a && (a += this.DB, --h)), i > 0 && (s = !0), s && (n += o(i));
							return s ? n : "0"
						}

						function d() {
							var t = i();
							return e.ZERO.subTo(this, t), t
						}

						function g() {
							return this.s < 0 ? this.negate() : this
						}

						function y(t) {
							var e = this.s - t.s;
							if(0 != e) return e;
							var i = this.t;
							if(e = i - t.t, 0 != e) return this.s < 0 ? -e : e;
							for(; --i >= 0;)
								if(0 != (e = this[i] - t[i])) return e;
							return 0
						}

						function m(t) {
							var e, i = 1;
							return 0 != (e = t >>> 16) && (t = e, i += 16), 0 != (e = t >> 8) && (t = e, i += 8), 0 != (e = t >> 4) && (t = e, i += 4), 0 != (e = t >> 2) && (t = e, i += 2), 0 != (e = t >> 1) && (t = e, i += 1), i
						}

						function b() {
							return this.t <= 0 ? 0 : this.DB * (this.t - 1) + m(this[this.t - 1] ^ this.s & this.DM)
						}

						function T(t, e) {
							var i;
							for(i = this.t - 1; i >= 0; --i) e[i + t] = this[i];
							for(i = t - 1; i >= 0; --i) e[i] = 0;
							e.t = this.t + t, e.s = this.s
						}

						function S(t, e) {
							for(var i = t; i < this.t; ++i) e[i - t] = this[i];
							e.t = Math.max(this.t - t, 0), e.s = this.s
						}

						function R(t, e) {
							var i, r = t % this.DB,
								s = this.DB - r,
								n = (1 << s) - 1,
								o = Math.floor(t / this.DB),
								h = this.s << r & this.DM;
							for(i = this.t - 1; i >= 0; --i) e[i + o + 1] = this[i] >> s | h, h = (this[i] & n) << r;
							for(i = o - 1; i >= 0; --i) e[i] = 0;
							e[o] = h, e.t = this.t + o + 1, e.s = this.s, e.clamp()
						}

						function E(t, e) {
							e.s = this.s;
							var i = Math.floor(t / this.DB);
							if(i >= this.t) return e.t = 0, void 0;
							var r = t % this.DB,
								s = this.DB - r,
								n = (1 << r) - 1;
							e[0] = this[i] >> r;
							for(var o = i + 1; o < this.t; ++o) e[o - i - 1] |= (this[o] & n) << s, e[o - i] = this[o] >> r;
							r > 0 && (e[this.t - i - 1] |= (this.s & n) << s), e.t = this.t - i, e.clamp()
						}

						function D(t, e) {
							for(var i = 0, r = 0, s = Math.min(t.t, this.t); s > i;) r += this[i] - t[i], e[i++] = r & this.DM, r >>= this.DB;
							if(t.t < this.t) {
								for(r -= t.s; i < this.t;) r += this[i], e[i++] = r & this.DM, r >>= this.DB;
								r += this.s
							} else {
								for(r += this.s; i < t.t;) r -= t[i], e[i++] = r & this.DM, r >>= this.DB;
								r -= t.s
							}
							e.s = 0 > r ? -1 : 0, -1 > r ? e[i++] = this.DV + r : r > 0 && (e[i++] = r), e.t = i, e.clamp()
						}

						function x(t, i) {
							var r = this.abs(),
								s = t.abs(),
								n = r.t;
							for(i.t = n + s.t; --n >= 0;) i[n] = 0;
							for(n = 0; n < s.t; ++n) i[n + r.t] = r.am(0, s[n], i, n, 0, r.t);
							i.s = 0, i.clamp(), this.s != t.s && e.ZERO.subTo(i, i)
						}

						function w(t) {
							for(var e = this.abs(), i = t.t = 2 * e.t; --i >= 0;) t[i] = 0;
							for(i = 0; i < e.t - 1; ++i) {
								var r = e.am(i, e[i], t, 2 * i, 0, 1);
								(t[i + e.t] += e.am(i + 1, 2 * e[i], t, 2 * i + 1, r, e.t - i - 1)) >= e.DV && (t[i + e.t] -= e.DV, t[i + e.t + 1] = 1)
							}
							t.t > 0 && (t[t.t - 1] += e.am(i, e[i], t, 2 * i, 0, 1)), t.s = 0, t.clamp()
						}

						function K(t, r, s) {
							var n = t.abs();
							if(!(n.t <= 0)) {
								var o = this.abs();
								if(o.t < n.t) return null != r && r.fromInt(0), null != s && this.copyTo(s), void 0;
								null == s && (s = i());
								var h = i(),
									a = this.s,
									u = t.s,
									c = this.DB - m(n[n.t - 1]);
								c > 0 ? (n.lShiftTo(c, h), o.lShiftTo(c, s)) : (n.copyTo(h), o.copyTo(s));
								var f = h.t,
									p = h[f - 1];
								if(0 != p) {
									var l = p * (1 << this.F1) + (f > 1 ? h[f - 2] >> this.F2 : 0),
										d = this.FV / l,
										g = (1 << this.F1) / l,
										y = 1 << this.F2,
										v = s.t,
										b = v - f,
										T = null == r ? i() : r;
									for(h.dlShiftTo(b, T), s.compareTo(T) >= 0 && (s[s.t++] = 1, s.subTo(T, s)), e.ONE.dlShiftTo(f, T), T.subTo(h, h); h.t < f;) h[h.t++] = 0;
									for(; --b >= 0;) {
										var S = s[--v] == p ? this.DM : Math.floor(s[v] * d + (s[v - 1] + y) * g);
										if((s[v] += h.am(0, S, s, b, 0, f)) < S)
											for(h.dlShiftTo(b, T), s.subTo(T, s); s[v] < --S;) s.subTo(T, s)
									}
									null != r && (s.drShiftTo(f, r), a != u && e.ZERO.subTo(r, r)), s.t = f, s.clamp(), c > 0 && s.rShiftTo(c, s), 0 > a && e.ZERO.subTo(s, s)
								}
							}
						}

						function B(t) {
							var r = i();
							return this.abs().divRemTo(t, null, r), this.s < 0 && r.compareTo(e.ZERO) > 0 && t.subTo(r, r), r
						}

						function A(t) {
							this.m = t
						}

						function U(t) {
							return t.s < 0 || t.compareTo(this.m) >= 0 ? t.mod(this.m) : t
						}

						function O(t) {
							return t
						}

						function V(t) {
							t.divRemTo(this.m, null, t)
						}

						function N(t, e, i) {
							t.multiplyTo(e, i), this.reduce(i)
						}

						function J(t, e) {
							t.squareTo(e), this.reduce(e)
						}

						function I() {
							if(this.t < 1) return 0;
							var t = this[0];
							if(0 == (1 & t)) return 0;
							var e = 3 & t;
							return e = e * (2 - (15 & t) * e) & 15, e = e * (2 - (255 & t) * e) & 255, e = e * (2 - ((65535 & t) * e & 65535)) & 65535, e = e * (2 - t * e % this.DV) % this.DV, e > 0 ? this.DV - e : -e
						}

						function P(t) {
							this.m = t, this.mp = t.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << t.DB - 15) - 1, this.mt2 = 2 * t.t
						}

						function M(t) {
							var r = i();
							return t.abs().dlShiftTo(this.m.t, r), r.divRemTo(this.m, null, r), t.s < 0 && r.compareTo(e.ZERO) > 0 && this.m.subTo(r, r), r
						}

						function L(t) {
							var e = i();
							return t.copyTo(e), this.reduce(e), e
						}

						function q(t) {
							for(; t.t <= this.mt2;) t[t.t++] = 0;
							for(var e = 0; e < this.m.t; ++e) {
								var i = 32767 & t[e],
									r = i * this.mpl + ((i * this.mph + (t[e] >> 15) * this.mpl & this.um) << 15) & t.DM;
								for(i = e + this.m.t, t[i] += this.m.am(0, r, t, e, 0, this.m.t); t[i] >= t.DV;) t[i] -= t.DV, t[++i]++
							}
							t.clamp(), t.drShiftTo(this.m.t, t), t.compareTo(this.m) >= 0 && t.subTo(this.m, t)
						}

						function C(t, e) {
							t.squareTo(e), this.reduce(e)
						}

						function H(t, e, i) {
							t.multiplyTo(e, i), this.reduce(i)
						}

						function j() {
							return 0 == (this.t > 0 ? 1 & this[0] : this.s)
						}

						function k(t, r) {
							if(t > 4294967295 || 1 > t) return e.ONE;
							var s = i(),
								n = i(),
								o = r.convert(this),
								h = m(t) - 1;
							for(o.copyTo(s); --h >= 0;)
								if(r.sqrTo(s, n), (t & 1 << h) > 0) r.mulTo(n, o, s);
								else {
									var a = s;
									s = n, n = a
								}
							return r.revert(s)
						}

						function F(t, e) {
							var i;
							return i = 256 > t || e.isEven() ? new A(e) : new P(e), this.exp(t, i)
						}

						function _() {
							var t = i();
							return this.copyTo(t), t
						}

						function z() {
							if(this.s < 0) {
								if(1 == this.t) return this[0] - this.DV;
								if(0 == this.t) return -1
							} else {
								if(1 == this.t) return this[0];
								if(0 == this.t) return 0
							}
							return(this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]
						}

						function Z() {
							return 0 == this.t ? this.s : this[0] << 24 >> 24
						}

						function G() {
							return 0 == this.t ? this.s : this[0] << 16 >> 16
						}

						function Y(t) {
							return Math.floor(Math.LN2 * this.DB / Math.log(t))
						}

						function W() {
							return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1
						}

						function Q(t) {
							if(null == t && (t = 10), 0 == this.signum() || 2 > t || t > 36) return "0";
							var e = this.chunkSize(t),
								r = Math.pow(t, e),
								s = c(r),
								n = i(),
								o = i(),
								h = "";
							for(this.divRemTo(s, n, o); n.signum() > 0;) h = (r + o.intValue()).toString(t).substr(1) + h, n.divRemTo(s, n, o);
							return o.intValue().toString(t) + h
						}

						function X(t, i) {
							this.fromInt(0), null == i && (i = 10);
							for(var r = this.chunkSize(i), s = Math.pow(i, r), n = !1, o = 0, a = 0, u = 0; u < t.length; ++u) {
								var c = h(t, u);
								0 > c ? "-" == t.charAt(u) && 0 == this.signum() && (n = !0) : (a = i * a + c, ++o >= r && (this.dMultiply(s), this.dAddOffset(a, 0), o = 0, a = 0))
							}
							o > 0 && (this.dMultiply(Math.pow(i, o)), this.dAddOffset(a, 0)), n && e.ZERO.subTo(this, this)
						}

						function te(t, i, r) {
							if("number" == typeof i)
								if(2 > t) this.fromInt(1);
								else
									for(this.fromNumber(t, r), this.testBit(t - 1) || this.bitwiseTo(e.ONE.shiftLeft(t - 1), ae, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(i);) this.dAddOffset(2, 0), this.bitLength() > t && this.subTo(e.ONE.shiftLeft(t - 1), this);
							else {
								var s = new Array,
									n = 7 & t;
								s.length = (t >> 3) + 1, i.nextBytes(s), n > 0 ? s[0] &= (1 << n) - 1 : s[0] = 0, this.fromString(s, 256)
							}
						}

						function ee() {
							var t = this.t,
								e = new Array;
							e[0] = this.s;
							var i, r = this.DB - t * this.DB % 8,
								s = 0;
							if(t-- > 0)
								for(r < this.DB && (i = this[t] >> r) != (this.s & this.DM) >> r && (e[s++] = i | this.s << this.DB - r); t >= 0;) 8 > r ? (i = (this[t] & (1 << r) - 1) << 8 - r, i |= this[--t] >> (r += this.DB - 8)) : (i = this[t] >> (r -= 8) & 255, 0 >= r && (r += this.DB, --t)), 0 != (128 & i) && (i |= -256), 0 == s && (128 & this.s) != (128 & i) && ++s, (s > 0 || i != this.s) && (e[s++] = i);
							return e
						}

						function ie(t) {
							return 0 == this.compareTo(t)
						}

						function re(t) {
							return this.compareTo(t) < 0 ? this : t
						}

						function se(t) {
							return this.compareTo(t) > 0 ? this : t
						}

						function ne(t, e, i) {
							var r, s, n = Math.min(t.t, this.t);
							for(r = 0; n > r; ++r) i[r] = e(this[r], t[r]);
							if(t.t < this.t) {
								for(s = t.s & this.DM, r = n; r < this.t; ++r) i[r] = e(this[r], s);
								i.t = this.t
							} else {
								for(s = this.s & this.DM, r = n; r < t.t; ++r) i[r] = e(s, t[r]);
								i.t = t.t
							}
							i.s = e(this.s, t.s), i.clamp()
						}

						function oe(t, e) {
							return t & e
						}

						function he(t) {
							var e = i();
							return this.bitwiseTo(t, oe, e), e
						}

						function ae(t, e) {
							return t | e
						}

						function ue(t) {
							var e = i();
							return this.bitwiseTo(t, ae, e), e
						}

						function ce(t, e) {
							return t ^ e
						}

						function fe(t) {
							var e = i();
							return this.bitwiseTo(t, ce, e), e
						}

						function pe(t, e) {
							return t & ~e
						}

						function le(t) {
							var e = i();
							return this.bitwiseTo(t, pe, e), e
						}

						function de() {
							for(var t = i(), e = 0; e < this.t; ++e) t[e] = this.DM & ~this[e];
							return t.t = this.t, t.s = ~this.s, t
						}

						function ge(t) {
							var e = i();
							return 0 > t ? this.rShiftTo(-t, e) : this.lShiftTo(t, e), e
						}

						function ye(t) {
							var e = i();
							return 0 > t ? this.lShiftTo(-t, e) : this.rShiftTo(t, e), e
						}

						function me(t) {
							if(0 == t) return -1;
							var e = 0;
							return 0 == (65535 & t) && (t >>= 16, e += 16), 0 == (255 & t) && (t >>= 8, e += 8), 0 == (15 & t) && (t >>= 4, e += 4), 0 == (3 & t) && (t >>= 2, e += 2), 0 == (1 & t) && ++e, e
						}

						function ve() {
							for(var t = 0; t < this.t; ++t)
								if(0 != this[t]) return t * this.DB + me(this[t]);
							return this.s < 0 ? this.t * this.DB : -1
						}

						function be(t) {
							for(var e = 0; 0 != t;) t &= t - 1, ++e;
							return e
						}

						function Te() {
							for(var t = 0, e = this.s & this.DM, i = 0; i < this.t; ++i) t += be(this[i] ^ e);
							return t
						}

						function Se(t) {
							var e = Math.floor(t / this.DB);
							return e >= this.t ? 0 != this.s : 0 != (this[e] & 1 << t % this.DB)
						}

						function Re(t, i) {
							var r = e.ONE.shiftLeft(t);
							return this.bitwiseTo(r, i, r), r
						}

						function Ee(t) {
							return this.changeBit(t, ae)
						}

						function De(t) {
							return this.changeBit(t, pe)
						}

						function xe(t) {
							return this.changeBit(t, ce)
						}

						function we(t, e) {
							for(var i = 0, r = 0, s = Math.min(t.t, this.t); s > i;) r += this[i] + t[i], e[i++] = r & this.DM, r >>= this.DB;
							if(t.t < this.t) {
								for(r += t.s; i < this.t;) r += this[i], e[i++] = r & this.DM, r >>= this.DB;
								r += this.s
							} else {
								for(r += this.s; i < t.t;) r += t[i], e[i++] = r & this.DM, r >>= this.DB;
								r += t.s
							}
							e.s = 0 > r ? -1 : 0, r > 0 ? e[i++] = r : -1 > r && (e[i++] = this.DV + r), e.t = i, e.clamp()
						}

						function Ke(t) {
							var e = i();
							return this.addTo(t, e), e
						}

						function Be(t) {
							var e = i();
							return this.subTo(t, e), e
						}

						function Ae(t) {
							var e = i();
							return this.multiplyTo(t, e), e
						}

						function Ue() {
							var t = i();
							return this.squareTo(t), t
						}

						function Oe(t) {
							var e = i();
							return this.divRemTo(t, e, null), e
						}

						function Ve(t) {
							var e = i();
							return this.divRemTo(t, null, e), e
						}

						function Ne(t) {
							var e = i(),
								r = i();
							return this.divRemTo(t, e, r), new Array(e, r)
						}

						function Je(t) {
							this[this.t] = this.am(0, t - 1, this, 0, 0, this.t), ++this.t, this.clamp()
						}

						function Ie(t, e) {
							if(0 != t) {
								for(; this.t <= e;) this[this.t++] = 0;
								for(this[e] += t; this[e] >= this.DV;) this[e] -= this.DV, ++e >= this.t && (this[this.t++] = 0), ++this[e]
							}
						}

						function Pe() {}

						function Me(t) {
							return t
						}

						function Le(t, e, i) {
							t.multiplyTo(e, i)
						}

						function qe(t, e) {
							t.squareTo(e)
						}

						function Ce(t) {
							return this.exp(t, new Pe)
						}

						function He(t, e, i) {
							var r = Math.min(this.t + t.t, e);
							for(i.s = 0, i.t = r; r > 0;) i[--r] = 0;
							var s;
							for(s = i.t - this.t; s > r; ++r) i[r + this.t] = this.am(0, t[r], i, r, 0, this.t);
							for(s = Math.min(t.t, e); s > r; ++r) this.am(0, t[r], i, r, 0, e - r);
							i.clamp()
						}

						function je(t, e, i) {
							--e;
							var r = i.t = this.t + t.t - e;
							for(i.s = 0; --r >= 0;) i[r] = 0;
							for(r = Math.max(e - this.t, 0); r < t.t; ++r) i[this.t + r - e] = this.am(e - r, t[r], i, 0, 0, this.t + r - e);
							i.clamp(), i.drShiftTo(1, i)
						}

						function ke(t) {
							this.r2 = i(), this.q3 = i(), e.ONE.dlShiftTo(2 * t.t, this.r2), this.mu = this.r2.divide(t), this.m = t
						}

						function Fe(t) {
							if(t.s < 0 || t.t > 2 * this.m.t) return t.mod(this.m);
							if(t.compareTo(this.m) < 0) return t;
							var e = i();
							return t.copyTo(e), this.reduce(e), e
						}

						function _e(t) {
							return t
						}

						function ze(t) {
							for(t.drShiftTo(this.m.t - 1, this.r2), t.t > this.m.t + 1 && (t.t = this.m.t + 1, t.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); t.compareTo(this.r2) < 0;) t.dAddOffset(1, this.m.t + 1);
							for(t.subTo(this.r2, t); t.compareTo(this.m) >= 0;) t.subTo(this.m, t)
						}

						function Ze(t, e) {
							t.squareTo(e), this.reduce(e)
						}

						function Ge(t, e, i) {
							t.multiplyTo(e, i), this.reduce(i)
						}

						function Ye(t, e) {
							var r, s, n = t.bitLength(),
								o = c(1);
							if(0 >= n) return o;
							r = 18 > n ? 1 : 48 > n ? 3 : 144 > n ? 4 : 768 > n ? 5 : 6, s = 8 > n ? new A(e) : e.isEven() ? new ke(e) : new P(e);
							var h = new Array,
								a = 3,
								u = r - 1,
								f = (1 << r) - 1;
							if(h[1] = s.convert(this), r > 1) {
								var p = i();
								for(s.sqrTo(h[1], p); f >= a;) h[a] = i(), s.mulTo(p, h[a - 2], h[a]), a += 2
							}
							var l, d, g = t.t - 1,
								y = !0,
								v = i();
							for(n = m(t[g]) - 1; g >= 0;) {
								for(n >= u ? l = t[g] >> n - u & f : (l = (t[g] & (1 << n + 1) - 1) << u - n, g > 0 && (l |= t[g - 1] >> this.DB + n - u)), a = r; 0 == (1 & l);) l >>= 1, --a;
								if((n -= a) < 0 && (n += this.DB, --g), y) h[l].copyTo(o), y = !1;
								else {
									for(; a > 1;) s.sqrTo(o, v), s.sqrTo(v, o), a -= 2;
									a > 0 ? s.sqrTo(o, v) : (d = o, o = v, v = d), s.mulTo(v, h[l], o)
								}
								for(; g >= 0 && 0 == (t[g] & 1 << n);) s.sqrTo(o, v), d = o, o = v, v = d, --n < 0 && (n = this.DB - 1, --g)
							}
							return s.revert(o)
						}

						function $e(t) {
							var e = this.s < 0 ? this.negate() : this.clone(),
								i = t.s < 0 ? t.negate() : t.clone();
							if(e.compareTo(i) < 0) {
								var r = e;
								e = i, i = r
							}
							var s = e.getLowestSetBit(),
								n = i.getLowestSetBit();
							if(0 > n) return e;
							for(n > s && (n = s), n > 0 && (e.rShiftTo(n, e), i.rShiftTo(n, i)); e.signum() > 0;)(s = e.getLowestSetBit()) > 0 && e.rShiftTo(s, e), (s = i.getLowestSetBit()) > 0 && i.rShiftTo(s, i), e.compareTo(i) >= 0 ? (e.subTo(i, e), e.rShiftTo(1, e)) : (i.subTo(e, i), i.rShiftTo(1, i));
							return n > 0 && i.lShiftTo(n, i), i
						}

						function We(t) {
							if(0 >= t) return 0;
							var e = this.DV % t,
								i = this.s < 0 ? t - 1 : 0;
							if(this.t > 0)
								if(0 == e) i = this[0] % t;
								else
									for(var r = this.t - 1; r >= 0; --r) i = (e * i + this[r]) % t;
							return i
						}

						function Qe(t) {
							var i = t.isEven();
							if(this.isEven() && i || 0 == t.signum()) return e.ZERO;
							for(var r = t.clone(), s = this.clone(), n = c(1), o = c(0), h = c(0), a = c(1); 0 != r.signum();) {
								for(; r.isEven();) r.rShiftTo(1, r), i ? (n.isEven() && o.isEven() || (n.addTo(this, n), o.subTo(t, o)), n.rShiftTo(1, n)) : o.isEven() || o.subTo(t, o), o.rShiftTo(1, o);
								for(; s.isEven();) s.rShiftTo(1, s), i ? (h.isEven() && a.isEven() || (h.addTo(this, h), a.subTo(t, a)), h.rShiftTo(1, h)) : a.isEven() || a.subTo(t, a), a.rShiftTo(1, a);
								r.compareTo(s) >= 0 ? (r.subTo(s, r), i && n.subTo(h, n), o.subTo(a, o)) : (s.subTo(r, s), i && h.subTo(n, h), a.subTo(o, a))
							}
							return 0 != s.compareTo(e.ONE) ? e.ZERO : a.compareTo(t) >= 0 ? a.subtract(t) : a.signum() < 0 ? (a.addTo(t, a), a.signum() < 0 ? a.add(t) : a) : a
						}

						function Xe(t) {
							var e, i = this.abs();
							if(1 == i.t && i[0] <= Vi[Vi.length - 1]) {
								for(e = 0; e < Vi.length; ++e)
									if(i[0] == Vi[e]) return !0;
								return !1
							}
							if(i.isEven()) return !1;
							for(e = 1; e < Vi.length;) {
								for(var r = Vi[e], s = e + 1; s < Vi.length && Ni > r;) r *= Vi[s++];
								for(r = i.modInt(r); s > e;)
									if(r % Vi[e++] == 0) return !1
							}
							return i.millerRabin(t)
						}

						function ti(t) {
							var r = this.subtract(e.ONE),
								s = r.getLowestSetBit();
							if(0 >= s) return !1;
							var n = r.shiftRight(s);
							t = t + 1 >> 1, t > Vi.length && (t = Vi.length);
							for(var o = i(), h = 0; t > h; ++h) {
								o.fromInt(Vi[Math.floor(Math.random() * Vi.length)]);
								var a = o.modPow(n, this);
								if(0 != a.compareTo(e.ONE) && 0 != a.compareTo(r)) {
									for(var u = 1; u++ < s && 0 != a.compareTo(r);)
										if(a = a.modPowInt(2, this), 0 == a.compareTo(e.ONE)) return !1;
									if(0 != a.compareTo(r)) return !1
								}
							}
							return !0
						}

						function ei() {
							this.i = 0, this.j = 0, this.S = new Array
						}

						function ii(t) {
							var e, i, r;
							for(e = 0; 256 > e; ++e) this.S[e] = e;
							for(i = 0, e = 0; 256 > e; ++e) i = i + this.S[e] + t[e % t.length] & 255, r = this.S[e], this.S[e] = this.S[i], this.S[i] = r;
							this.i = 0, this.j = 0
						}

						function ri() {
							var t;
							return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255]
						}

						function si() {
							return new ei
						}

						function ni(t) {
							Ii[Pi++] ^= 255 & t, Ii[Pi++] ^= t >> 8 & 255, Ii[Pi++] ^= t >> 16 & 255, Ii[Pi++] ^= t >> 24 & 255, Pi >= Mi && (Pi -= Mi)
						}

						function oi() {
							ni((new Date).getTime())
						}

						function hi() {
							if(null == Ji) {
								for(oi(), Ji = si(), Ji.init(Ii), Pi = 0; Pi < Ii.length; ++Pi) Ii[Pi] = 0;
								Pi = 0
							}
							return Ji.next()
						}

						function ai(t) {
							var e;
							for(e = 0; e < t.length; ++e) t[e] = hi()
						}

						function ui() {}

						function ci(t, i) {
							return new e(t, i)
						}

						function fi(t, i) {
							if(i < t.length + 11) return console.error("Message too long for RSA"), null;
							for(var r = new Array, s = t.length - 1; s >= 0 && i > 0;) {
								var n = t.charCodeAt(s--);
								128 > n ? r[--i] = n : n > 127 && 2048 > n ? (r[--i] = 63 & n | 128, r[--i] = n >> 6 | 192) : (r[--i] = 63 & n | 128, r[--i] = n >> 6 & 63 | 128, r[--i] = n >> 12 | 224)
							}
							r[--i] = 0;
							for(var o = new ui, h = new Array; i > 2;) {
								for(h[0] = 0; 0 == h[0];) o.nextBytes(h);
								r[--i] = h[0]
							}
							return r[--i] = 2, r[--i] = 0, new e(r)
						}

						function pi() {
							this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null
						}

						function li(t, e) {
							null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ci(t, 16), this.e = parseInt(e, 16)) : console.error("Invalid RSA public key")
						}

						function di(t) {
							return t.modPowInt(this.e, this.n)
						}

						function gi(t) {
							var e = fi(t, this.n.bitLength() + 7 >> 3);
							if(null == e) return null;
							var i = this.doPublic(e);
							if(null == i) return null;
							var r = i.toString(16);
							return 0 == (1 & r.length) ? r : "0" + r
						}

						function yi(t, e) {
							for(var i = t.toByteArray(), r = 0; r < i.length && 0 == i[r];) ++r;
							if(i.length - r != e - 1 || 2 != i[r]) return null;
							for(++r; 0 != i[r];)
								if(++r >= i.length) return null;
							for(var s = ""; ++r < i.length;) {
								var n = 255 & i[r];
								128 > n ? s += String.fromCharCode(n) : n > 191 && 224 > n ? (s += String.fromCharCode((31 & n) << 6 | 63 & i[r + 1]), ++r) : (s += String.fromCharCode((15 & n) << 12 | (63 & i[r + 1]) << 6 | 63 & i[r + 2]), r += 2)
							}
							return s
						}

						function mi(t, e, i) {
							null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ci(t, 16), this.e = parseInt(e, 16), this.d = ci(i, 16)) : console.error("Invalid RSA private key")
						}

						function vi(t, e, i, r, s, n, o, h) {
							null != t && null != e && t.length > 0 && e.length > 0 ? (this.n = ci(t, 16), this.e = parseInt(e, 16), this.d = ci(i, 16), this.p = ci(r, 16), this.q = ci(s, 16), this.dmp1 = ci(n, 16), this.dmq1 = ci(o, 16), this.coeff = ci(h, 16)) : console.error("Invalid RSA private key")
						}

						function bi(t, i) {
							var r = new ui,
								s = t >> 1;
							this.e = parseInt(i, 16);
							for(var n = new e(i, 16);;) {
								for(; this.p = new e(t - s, 1, r), 0 != this.p.subtract(e.ONE).gcd(n).compareTo(e.ONE) || !this.p.isProbablePrime(10););
								for(; this.q = new e(s, 1, r), 0 != this.q.subtract(e.ONE).gcd(n).compareTo(e.ONE) || !this.q.isProbablePrime(10););
								if(this.p.compareTo(this.q) <= 0) {
									var o = this.p;
									this.p = this.q, this.q = o
								}
								var h = this.p.subtract(e.ONE),
									a = this.q.subtract(e.ONE),
									u = h.multiply(a);
								if(0 == u.gcd(n).compareTo(e.ONE)) {
									this.n = this.p.multiply(this.q), this.d = n.modInverse(u), this.dmp1 = this.d.mod(h), this.dmq1 = this.d.mod(a), this.coeff = this.q.modInverse(this.p);
									break
								}
							}
						}

						function Ti(t) {
							if(null == this.p || null == this.q) return t.modPow(this.d, this.n);
							for(var e = t.mod(this.p).modPow(this.dmp1, this.p), i = t.mod(this.q).modPow(this.dmq1, this.q); e.compareTo(i) < 0;) e = e.add(this.p);
							return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)
						}

						function Si(t) {
							var e = ci(t, 16),
								i = this.doPrivate(e);
							return null == i ? null : yi(i, this.n.bitLength() + 7 >> 3)
						}

						function Ri(t) {
							var e, i, r = "";
							for(e = 0; e + 3 <= t.length; e += 3) i = parseInt(t.substring(e, e + 3), 16), r += Ci.charAt(i >> 6) + Ci.charAt(63 & i);
							for(e + 1 == t.length ? (i = parseInt(t.substring(e, e + 1), 16), r += Ci.charAt(i << 2)) : e + 2 == t.length && (i = parseInt(t.substring(e, e + 2), 16), r += Ci.charAt(i >> 2) + Ci.charAt((3 & i) << 4));
								(3 & r.length) > 0;) r += Hi;
							return r
						}

						function Ei(t) {
							var e, i, r = "",
								s = 0;
							for(e = 0; e < t.length && t.charAt(e) != Hi; ++e) v = Ci.indexOf(t.charAt(e)), 0 > v || (0 == s ? (r += o(v >> 2), i = 3 & v, s = 1) : 1 == s ? (r += o(i << 2 | v >> 4), i = 15 & v, s = 2) : 2 == s ? (r += o(i), r += o(v >> 2), i = 3 & v, s = 3) : (r += o(i << 2 | v >> 4), r += o(15 & v), s = 0));
							return 1 == s && (r += o(i << 2)), r
						}
						var Di, xi = 0xdeadbeefcafe,
							wi = 15715070 == (16777215 & xi);
						wi && "Microsoft Internet Explorer" == navigator.appName ? (e.prototype.am = s, Di = 30) : wi && "Netscape" != navigator.appName ? (e.prototype.am = r, Di = 26) : (e.prototype.am = n, Di = 28), e.prototype.DB = Di, e.prototype.DM = (1 << Di) - 1, e.prototype.DV = 1 << Di;
						var Ki = 52;
						e.prototype.FV = Math.pow(2, Ki), e.prototype.F1 = Ki - Di, e.prototype.F2 = 2 * Di - Ki;
						var Bi, Ai, Ui = "0123456789abcdefghijklmnopqrstuvwxyz",
							Oi = new Array;
						for(Bi = "0".charCodeAt(0), Ai = 0; 9 >= Ai; ++Ai) Oi[Bi++] = Ai;
						for(Bi = "a".charCodeAt(0), Ai = 10; 36 > Ai; ++Ai) Oi[Bi++] = Ai;
						for(Bi = "A".charCodeAt(0), Ai = 10; 36 > Ai; ++Ai) Oi[Bi++] = Ai;
						A.prototype.convert = U, A.prototype.revert = O, A.prototype.reduce = V, A.prototype.mulTo = N, A.prototype.sqrTo = J, P.prototype.convert = M, P.prototype.revert = L, P.prototype.reduce = q, P.prototype.mulTo = H, P.prototype.sqrTo = C, e.prototype.copyTo = a, e.prototype.fromInt = u, e.prototype.fromString = f, e.prototype.clamp = p, e.prototype.dlShiftTo = T, e.prototype.drShiftTo = S, e.prototype.lShiftTo = R, e.prototype.rShiftTo = E, e.prototype.subTo = D, e.prototype.multiplyTo = x, e.prototype.squareTo = w, e.prototype.divRemTo = K, e.prototype.invDigit = I, e.prototype.isEven = j, e.prototype.exp = k, e.prototype.toString = l, e.prototype.negate = d, e.prototype.abs = g, e.prototype.compareTo = y, e.prototype.bitLength = b, e.prototype.mod = B, e.prototype.modPowInt = F, e.ZERO = c(0), e.ONE = c(1), Pe.prototype.convert = Me, Pe.prototype.revert = Me, Pe.prototype.mulTo = Le, Pe.prototype.sqrTo = qe, ke.prototype.convert = Fe, ke.prototype.revert = _e, ke.prototype.reduce = ze, ke.prototype.mulTo = Ge, ke.prototype.sqrTo = Ze;
						var Vi = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997],
							Ni = (1 << 26) / Vi[Vi.length - 1];
						e.prototype.chunkSize = Y, e.prototype.toRadix = Q, e.prototype.fromRadix = X, e.prototype.fromNumber = te, e.prototype.bitwiseTo = ne, e.prototype.changeBit = Re, e.prototype.addTo = we, e.prototype.dMultiply = Je, e.prototype.dAddOffset = Ie, e.prototype.multiplyLowerTo = He, e.prototype.multiplyUpperTo = je, e.prototype.modInt = We, e.prototype.millerRabin = ti, e.prototype.clone = _, e.prototype.intValue = z, e.prototype.byteValue = Z, e.prototype.shortValue = G, e.prototype.signum = W, e.prototype.toByteArray = ee, e.prototype.equals = ie, e.prototype.min = re, e.prototype.max = se, e.prototype.and = he, e.prototype.or = ue, e.prototype.xor = fe, e.prototype.andNot = le, e.prototype.not = de, e.prototype.shiftLeft = ge, e.prototype.shiftRight = ye, e.prototype.getLowestSetBit = ve, e.prototype.bitCount = Te, e.prototype.testBit = Se, e.prototype.setBit = Ee, e.prototype.clearBit = De, e.prototype.flipBit = xe, e.prototype.add = Ke, e.prototype.subtract = Be, e.prototype.multiply = Ae, e.prototype.divide = Oe, e.prototype.remainder = Ve, e.prototype.divideAndRemainder = Ne, e.prototype.modPow = Ye, e.prototype.modInverse = Qe, e.prototype.pow = Ce, e.prototype.gcd = $e, e.prototype.isProbablePrime = Xe, e.prototype.square = Ue, ei.prototype.init = ii, ei.prototype.next = ri;
						var Ji, Ii, Pi, Mi = 256;
						if(null == Ii) {
							Ii = new Array, Pi = 0;
							var Li;
							if("Netscape" == navigator.appName && navigator.appVersion < "5" && window.crypto) {
								var qi = window.crypto.random(32);
								for(Li = 0; Li < qi.length; ++Li) Ii[Pi++] = 255 & qi.charCodeAt(Li)
							}
							for(; Mi > Pi;) Li = Math.floor(65536 * Math.random()), Ii[Pi++] = Li >>> 8, Ii[Pi++] = 255 & Li;
							Pi = 0, oi()
						}
						ui.prototype.nextBytes = ai, pi.prototype.doPublic = di, pi.prototype.setPublic = li, pi.prototype.encrypt = gi, pi.prototype.doPrivate = Ti, pi.prototype.setPrivate = mi, pi.prototype.setPrivateEx = vi, pi.prototype.generate = bi, pi.prototype.decrypt = Si,
							function() {
								var t = function(t, r, s) {
									var n = new ui,
										o = t >> 1;
									this.e = parseInt(r, 16);
									var h = new e(r, 16),
										a = this,
										u = function() {
											var r = function() {
													if(a.p.compareTo(a.q) <= 0) {
														var t = a.p;
														a.p = a.q, a.q = t
													}
													var i = a.p.subtract(e.ONE),
														r = a.q.subtract(e.ONE),
														n = i.multiply(r);
													0 == n.gcd(h).compareTo(e.ONE) ? (a.n = a.p.multiply(a.q), a.d = h.modInverse(n), a.dmp1 = a.d.mod(i), a.dmq1 = a.d.mod(r), a.coeff = a.q.modInverse(a.p), setTimeout(function() {
														s()
													}, 0)) : setTimeout(u, 0)
												},
												c = function() {
													a.q = i(), a.q.fromNumberAsync(o, 1, n, function() {
														a.q.subtract(e.ONE).gcda(h, function(t) {
															0 == t.compareTo(e.ONE) && a.q.isProbablePrime(10) ? setTimeout(r, 0) : setTimeout(c, 0)
														})
													})
												},
												f = function() {
													a.p = i(), a.p.fromNumberAsync(t - o, 1, n, function() {
														a.p.subtract(e.ONE).gcda(h, function(t) {
															0 == t.compareTo(e.ONE) && a.p.isProbablePrime(10) ? setTimeout(c, 0) : setTimeout(f, 0)
														})
													})
												};
											setTimeout(f, 0)
										};
									setTimeout(u, 0)
								};
								pi.prototype.generateAsync = t;
								var r = function(t, e) {
									var i = this.s < 0 ? this.negate() : this.clone(),
										r = t.s < 0 ? t.negate() : t.clone();
									if(i.compareTo(r) < 0) {
										var s = i;
										i = r, r = s
									}
									var n = i.getLowestSetBit(),
										o = r.getLowestSetBit();
									if(0 > o) return e(i), void 0;
									o > n && (o = n), o > 0 && (i.rShiftTo(o, i), r.rShiftTo(o, r));
									var h = function() {
										(n = i.getLowestSetBit()) > 0 && i.rShiftTo(n, i), (n = r.getLowestSetBit()) > 0 && r.rShiftTo(n, r), i.compareTo(r) >= 0 ? (i.subTo(r, i), i.rShiftTo(1, i)) : (r.subTo(i, r), r.rShiftTo(1, r)), i.signum() > 0 ? setTimeout(h, 0) : (o > 0 && r.lShiftTo(o, r), setTimeout(function() {
											e(r)
										}, 0))
									};
									setTimeout(h, 10)
								};
								e.prototype.gcda = r;
								var s = function(t, i, r, s) {
									if("number" == typeof i)
										if(2 > t) this.fromInt(1);
										else {
											this.fromNumber(t, r), this.testBit(t - 1) || this.bitwiseTo(e.ONE.shiftLeft(t - 1), ae, this), this.isEven() && this.dAddOffset(1, 0);
											var n = this,
												o = function() {
													n.dAddOffset(2, 0), n.bitLength() > t && n.subTo(e.ONE.shiftLeft(t - 1), n), n.isProbablePrime(i) ? setTimeout(function() {
														s()
													}, 0) : setTimeout(o, 0)
												};
											setTimeout(o, 0)
										}
									else {
										var h = new Array,
											a = 7 & t;
										h.length = (t >> 3) + 1, i.nextBytes(h), a > 0 ? h[0] &= (1 << a) - 1 : h[0] = 0, this.fromString(h, 256)
									}
								};
								e.prototype.fromNumberAsync = s
							}();
						var Ci = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
							Hi = "=",
							ji = ji || {};
						ji.env = ji.env || {};
						var ki = ji,
							Fi = Object.prototype,
							_i = "[object Function]",
							zi = ["toString", "valueOf"];
						ji.env.parseUA = function(t) {
								var e, i = function(t) {
										var e = 0;
										return parseFloat(t.replace(/\./g, function() {
											return 1 == e++ ? "" : "."
										}))
									},
									r = navigator,
									s = {
										ie: 0,
										opera: 0,
										gecko: 0,
										webkit: 0,
										chrome: 0,
										mobile: null,
										air: 0,
										ipad: 0,
										iphone: 0,
										ipod: 0,
										ios: null,
										android: 0,
										webos: 0,
										caja: r && r.cajaVersion,
										secure: !1,
										os: null
									},
									n = t || navigator && navigator.userAgent,
									o = $.tb.location,
									h = o && o.getHref();
								return s.secure = h && 0 === h.toLowerCase().indexOf("https"), n && (/windows|win32/i.test(n) ? s.os = "windows" : /macintosh/i.test(n) ? s.os = "macintosh" : /rhino/i.test(n) && (s.os = "rhino"), /KHTML/.test(n) && (s.webkit = 1), e = n.match(/AppleWebKit\/([^\s]*)/), e && e[1] && (s.webkit = i(e[1]), / Mobile\//.test(n) ? (s.mobile = "Apple", e = n.match(/OS ([^\s]*)/), e && e[1] && (e = i(e[1].replace("_", "."))), s.ios = e, s.ipad = s.ipod = s.iphone = 0, e = n.match(/iPad|iPod|iPhone/), e && e[0] && (s[e[0].toLowerCase()] = s.ios)) : (e = n.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/), e && (s.mobile = e[0]), /webOS/.test(n) && (s.mobile = "WebOS", e = n.match(/webOS\/([^\s]*);/), e && e[1] && (s.webos = i(e[1]))), / Android/.test(n) && (s.mobile = "Android", e = n.match(/Android ([^\s]*);/), e && e[1] && (s.android = i(e[1])))), e = n.match(/Chrome\/([^\s]*)/), e && e[1] ? s.chrome = i(e[1]) : (e = n.match(/AdobeAIR\/([^\s]*)/), e && (s.air = e[0]))), s.webkit || (e = n.match(/Opera[\s\/]([^\s]*)/), e && e[1] ? (s.opera = i(e[1]), e = n.match(/Version\/([^\s]*)/), e && e[1] && (s.opera = i(e[1])), e = n.match(/Opera Mini[^;]*/), e && (s.mobile = e[0])) : (e = n.match(/MSIE\s([^;]*)/), e && e[1] ? s.ie = i(e[1]) : (e = n.match(/Gecko\/([^\s]*)/), e && (s.gecko = 1, e = n.match(/rv:([^\s\)]*)/), e && e[1] && (s.gecko = i(e[1]))))))), s
							}, ji.env.ua = ji.env.parseUA(), ji.isFunction = function(t) {
								return "function" == typeof t || Fi.toString.apply(t) === _i
							}, ji._IEEnumFix = ji.env.ua.ie ? function(t, e) {
								var i, r, s;
								for(i = 0; i < zi.length; i += 1) r = zi[i], s = e[r], ki.isFunction(s) && s != Fi[r] && (t[r] = s)
							} : function() {}, ji.extend = function(t, e, i) {
								if(!e || !t) throw new Error("extend failed, please check that all dependencies are included.");
								var r, s = function() {};
								if(s.prototype = e.prototype, t.prototype = new s, t.prototype.constructor = t, t.superclass = e.prototype, e.prototype.constructor == Fi.constructor && (e.prototype.constructor = e), i) {
									for(r in i) ki.hasOwnProperty(i, r) && (t.prototype[r] = i[r]);
									ki._IEEnumFix(t.prototype, i)
								}
							}, "undefined" != typeof KJUR && KJUR || (KJUR = {}), "undefined" != typeof KJUR.asn1 && KJUR.asn1 || (KJUR.asn1 = {}), KJUR.asn1.ASN1Util = new function() {
								this.integerToByteHex = function(t) {
									var e = t.toString(16);
									return e.length % 2 == 1 && (e = "0" + e), e
								}, this.bigIntToMinTwosComplementsHex = function(t) {
									var i = t.toString(16);
									if("-" != i.substr(0, 1)) i.length % 2 == 1 ? i = "0" + i : i.match(/^[0-7]/) || (i = "00" + i);
									else {
										var r = i.substr(1),
											s = r.length;
										s % 2 == 1 ? s += 1 : i.match(/^[0-7]/) || (s += 2);
										for(var n = "", o = 0; s > o; o++) n += "f";
										var h = new e(n, 16),
											a = h.xor(t).add(e.ONE);
										i = a.toString(16).replace(/^-/, "")
									}
									return i
								}, this.getPEMStringFromHex = function(t, e) {
									var i = CryptoJS.enc.Hex.parse(t),
										r = CryptoJS.enc.Base64.stringify(i),
										s = r.replace(/(.{64})/g, "$1\r\n");
									return s = s.replace(/\r\n$/, ""), "-----BEGIN " + e + "-----\r\n" + s + "\r\n-----END " + e + "-----\r\n"
								}
							}, KJUR.asn1.ASN1Object = function() {
								var t = "";
								this.getLengthHexFromValue = function() {
									if("undefined" == typeof this.hV || null == this.hV) throw "this.hV is null or undefined.";
									if(this.hV.length % 2 == 1) throw "value hex must be even length: n=" + t.length + ",v=" + this.hV;
									var e = this.hV.length / 2,
										i = e.toString(16);
									if(i.length % 2 == 1 && (i = "0" + i), 128 > e) return i;
									var r = i.length / 2;
									if(r > 15) throw "ASN.1 length too long to represent by 8x: n = " + e.toString(16);
									var s = 128 + r;
									return s.toString(16) + i
								}, this.getEncodedHex = function() {
									return(null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV
								}, this.getValueHex = function() {
									return this.getEncodedHex(), this.hV
								}, this.getFreshValueHex = function() {
									return ""
								}
							}, KJUR.asn1.DERAbstractString = function(t) {
								KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
								this.getString = function() {
									return this.s
								}, this.setString = function(t) {
									this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s)
								}, this.setStringHex = function(t) {
									this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t
								}, this.getFreshValueHex = function() {
									return this.hV
								}, "undefined" != typeof t && ("undefined" != typeof t.str ? this.setString(t.str) : "undefined" != typeof t.hex && this.setStringHex(t.hex))
							}, ji.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractTime = function() {
								KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);
								this.localDateToUTC = function(t) {
									utc = t.getTime() + 6e4 * t.getTimezoneOffset();
									var e = new Date(utc);
									return e
								}, this.formatDate = function(t, e) {
									var i = this.zeroPadding,
										r = this.localDateToUTC(t),
										s = String(r.getFullYear());
									"utc" == e && (s = s.substr(2, 2));
									var n = i(String(r.getMonth() + 1), 2),
										o = i(String(r.getDate()), 2),
										h = i(String(r.getHours()), 2),
										a = i(String(r.getMinutes()), 2),
										u = i(String(r.getSeconds()), 2);
									return s + n + o + h + a + u + "Z"
								}, this.zeroPadding = function(t, e) {
									return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t
								}, this.getString = function() {
									return this.s
								}, this.setString = function(t) {
									this.hTLV = null, this.isModified = !0, this.s = t, this.hV = stohex(this.s)
								}, this.setByDateValue = function(t, e, i, r, s, n) {
									var o = new Date(Date.UTC(t, e - 1, i, r, s, n, 0));
									this.setByDate(o)
								}, this.getFreshValueHex = function() {
									return this.hV
								}
							}, ji.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractStructured = function(t) {
								KJUR.asn1.DERAbstractString.superclass.constructor.call(this);
								this.setByASN1ObjectArray = function(t) {
									this.hTLV = null, this.isModified = !0, this.asn1Array = t
								}, this.appendASN1Object = function(t) {
									this.hTLV = null, this.isModified = !0, this.asn1Array.push(t)
								}, this.asn1Array = new Array, "undefined" != typeof t && "undefined" != typeof t.array && (this.asn1Array = t.array)
							}, ji.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object), KJUR.asn1.DERBoolean = function() {
								KJUR.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff"
							}, ji.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object), KJUR.asn1.DERInteger = function(t) {
								KJUR.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function(t) {
									this.hTLV = null, this.isModified = !0, this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)
								}, this.setByInteger = function(t) {
									var i = new e(String(t), 10);
									this.setByBigInteger(i)
								}, this.setValueHex = function(t) {
									this.hV = t
								}, this.getFreshValueHex = function() {
									return this.hV
								}, "undefined" != typeof t && ("undefined" != typeof t.bigint ? this.setByBigInteger(t.bigint) : "undefined" != typeof t["int"] ? this.setByInteger(t["int"]) : "undefined" != typeof t.hex && this.setValueHex(t.hex))
							}, ji.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object), KJUR.asn1.DERBitString = function(t) {
								KJUR.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function(t) {
									this.hTLV = null, this.isModified = !0, this.hV = t
								}, this.setUnusedBitsAndHexValue = function(t, e) {
									if(0 > t || t > 7) throw "unused bits shall be from 0 to 7: u = " + t;
									var i = "0" + t;
									this.hTLV = null, this.isModified = !0, this.hV = i + e
								}, this.setByBinaryString = function(t) {
									t = t.replace(/0+$/, "");
									var e = 8 - t.length % 8;
									8 == e && (e = 0);
									for(var i = 0; e >= i; i++) t += "0";
									for(var r = "", i = 0; i < t.length - 1; i += 8) {
										var s = t.substr(i, 8),
											n = parseInt(s, 2).toString(16);
										1 == n.length && (n = "0" + n), r += n
									}
									this.hTLV = null, this.isModified = !0, this.hV = "0" + e + r
								}, this.setByBooleanArray = function(t) {
									for(var e = "", i = 0; i < t.length; i++) e += 1 == t[i] ? "1" : "0";
									this.setByBinaryString(e)
								}, this.newFalseArray = function(t) {
									for(var e = new Array(t), i = 0; t > i; i++) e[i] = !1;
									return e
								}, this.getFreshValueHex = function() {
									return this.hV
								}, "undefined" != typeof t && ("undefined" != typeof t.hex ? this.setHexValueIncludingUnusedBits(t.hex) : "undefined" != typeof t.bin ? this.setByBinaryString(t.bin) : "undefined" != typeof t.array && this.setByBooleanArray(t.array))
							}, ji.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object), KJUR.asn1.DEROctetString = function(t) {
								KJUR.asn1.DEROctetString.superclass.constructor.call(this, t), this.hT = "04"
							}, ji.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNull = function() {
								KJUR.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500"
							}, ji.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object), KJUR.asn1.DERObjectIdentifier = function(t) {
								var i = function(t) {
										var e = t.toString(16);
										return 1 == e.length && (e = "0" + e), e
									},
									r = function(t) {
										var r = "",
											s = new e(t, 10),
											n = s.toString(2),
											o = 7 - n.length % 7;
										7 == o && (o = 0);
										for(var h = "", a = 0; o > a; a++) h += "0";
										n = h + n;
										for(var a = 0; a < n.length - 1; a += 7) {
											var u = n.substr(a, 7);
											a != n.length - 7 && (u = "1" + u), r += i(parseInt(u, 2))
										}
										return r
									};
								KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function(t) {
									this.hTLV = null, this.isModified = !0, this.s = null, this.hV = t
								}, this.setValueOidString = function(t) {
									if(!t.match(/^[0-9.]+$/)) throw "malformed oid string: " + t;
									var e = "",
										s = t.split("."),
										n = 40 * parseInt(s[0]) + parseInt(s[1]);
									e += i(n), s.splice(0, 2);
									for(var o = 0; o < s.length; o++) e += r(s[o]);
									this.hTLV = null, this.isModified = !0, this.s = null, this.hV = e
								}, this.setValueName = function(t) {
									if("undefined" == typeof KJUR.asn1.x509.OID.name2oidList[t]) throw "DERObjectIdentifier oidName undefined: " + t;
									var e = KJUR.asn1.x509.OID.name2oidList[t];
									this.setValueOidString(e)
								}, this.getFreshValueHex = function() {
									return this.hV
								}, "undefined" != typeof t && ("undefined" != typeof t.oid ? this.setValueOidString(t.oid) : "undefined" != typeof t.hex ? this.setValueHex(t.hex) : "undefined" != typeof t.name && this.setValueName(t.name))
							}, ji.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object), KJUR.asn1.DERUTF8String = function(t) {
								KJUR.asn1.DERUTF8String.superclass.constructor.call(this, t), this.hT = "0c"
							}, ji.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNumericString = function(t) {
								KJUR.asn1.DERNumericString.superclass.constructor.call(this, t), this.hT = "12"
							}, ji.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERPrintableString = function(t) {
								KJUR.asn1.DERPrintableString.superclass.constructor.call(this, t), this.hT = "13"
							}, ji.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERTeletexString = function(t) {
								KJUR.asn1.DERTeletexString.superclass.constructor.call(this, t), this.hT = "14"
							}, ji.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERIA5String = function(t) {
								KJUR.asn1.DERIA5String.superclass.constructor.call(this, t), this.hT = "16"
							}, ji.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERUTCTime = function(t) {
								KJUR.asn1.DERUTCTime.superclass.constructor.call(this, t), this.hT = "17", this.setByDate = function(t) {
									this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s)
								}, "undefined" != typeof t && ("undefined" != typeof t.str ? this.setString(t.str) : "undefined" != typeof t.hex ? this.setStringHex(t.hex) : "undefined" != typeof t.date && this.setByDate(t.date))
							}, ji.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERGeneralizedTime = function(t) {
								KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, t), this.hT = "18", this.setByDate = function(t) {
									this.hTLV = null, this.isModified = !0, this.date = t, this.s = this.formatDate(this.date, "gen"), this.hV = stohex(this.s)
								}, "undefined" != typeof t && ("undefined" != typeof t.str ? this.setString(t.str) : "undefined" != typeof t.hex ? this.setStringHex(t.hex) : "undefined" != typeof t.date && this.setByDate(t.date))
							}, ji.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERSequence = function(t) {
								KJUR.asn1.DERSequence.superclass.constructor.call(this, t), this.hT = "30", this.getFreshValueHex = function() {
									for(var t = "", e = 0; e < this.asn1Array.length; e++) {
										var i = this.asn1Array[e];
										t += i.getEncodedHex()
									}
									return this.hV = t, this.hV
								}
							}, ji.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERSet = function(t) {
								KJUR.asn1.DERSet.superclass.constructor.call(this, t), this.hT = "31", this.getFreshValueHex = function() {
									for(var t = new Array, e = 0; e < this.asn1Array.length; e++) {
										var i = this.asn1Array[e];
										t.push(i.getEncodedHex())
									}
									return t.sort(), this.hV = t.join(""), this.hV
								}
							}, ji.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERTaggedObject = function(t) {
								KJUR.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function(t, e, i) {
									this.hT = e, this.isExplicit = t, this.asn1Object = i, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = i.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, e), this.isModified = !1)
								}, this.getFreshValueHex = function() {
									return this.hV
								}, "undefined" != typeof t && ("undefined" != typeof t.tag && (this.hT = t.tag), "undefined" != typeof t.explicit && (this.isExplicit = t.explicit), "undefined" != typeof t.obj && (this.asn1Object = t.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object)))
							}, ji.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object),
							function(t) {
								"use strict";
								var e, i = {};
								i.decode = function(i) {
									var r;
									if(e === t) {
										var s = "0123456789ABCDEF",
											n = " \f\n\r	\xa0\u2028\u2029";
										for(e = [], r = 0; 16 > r; ++r) e[s.charAt(r)] = r;
										for(s = s.toLowerCase(), r = 10; 16 > r; ++r) e[s.charAt(r)] = r;
										for(r = 0; r < n.length; ++r) e[n.charAt(r)] = -1
									}
									var o = [],
										h = 0,
										a = 0;
									for(r = 0; r < i.length; ++r) {
										var u = i.charAt(r);
										if("=" == u) break;
										if(u = e[u], -1 != u) {
											if(u === t) throw "Illegal character at offset " + r;
											h |= u, ++a >= 2 ? (o[o.length] = h, h = 0, a = 0) : h <<= 4
										}
									}
									if(a) throw "Hex encoding incomplete: 4 bits missing";
									return o
								}, window.Hex = i
							}(),
							function(t) {
								"use strict";
								var e, i = {};
								i.decode = function(i) {
									var r;
									if(e === t) {
										var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
											n = "= \f\n\r	\xa0\u2028\u2029";
										for(e = [], r = 0; 64 > r; ++r) e[s.charAt(r)] = r;
										for(r = 0; r < n.length; ++r) e[n.charAt(r)] = -1
									}
									var o = [],
										h = 0,
										a = 0;
									for(r = 0; r < i.length; ++r) {
										var u = i.charAt(r);
										if("=" == u) break;
										if(u = e[u], -1 != u) {
											if(u === t) throw "Illegal character at offset " + r;
											h |= u, ++a >= 4 ? (o[o.length] = h >> 16, o[o.length] = h >> 8 & 255, o[o.length] = 255 & h, h = 0, a = 0) : h <<= 6
										}
									}
									switch(a) {
										case 1:
											throw "Base64 encoding incomplete: at least 2 bits missing";
										case 2:
											o[o.length] = h >> 10;
											break;
										case 3:
											o[o.length] = h >> 16, o[o.length] = h >> 8 & 255
									}
									return o
								}, i.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/, i.unarmor = function(t) {
									var e = i.re.exec(t);
									if(e)
										if(e[1]) t = e[1];
										else {
											if(!e[2]) throw "RegExp out of sync";
											t = e[2]
										}
									return i.decode(t)
								}, window.Base64 = i
							}(),
							function(t) {
								"use strict";

								function e(t, i) {
									t instanceof e ? (this.enc = t.enc, this.pos = t.pos) : (this.enc = t, this.pos = i)
								}

								function i(t, e, i, r, s) {
									this.stream = t, this.header = e, this.length = i, this.tag = r, this.sub = s
								}
								var r = 100,
									s = "\u2026",
									n = {
										tag: function(t, e) {
											var i = document.createElement(t);
											return i.className = e, i
										},
										text: function(t) {
											return document.createTextNode(t)
										}
									};
								e.prototype.get = function(e) {
									if(e === t && (e = this.pos++), e >= this.enc.length) throw "Requesting byte offset " + e + " on a stream of length " + this.enc.length;
									return this.enc[e]
								}, e.prototype.hexDigits = "0123456789ABCDEF", e.prototype.hexByte = function(t) {
									return this.hexDigits.charAt(t >> 4 & 15) + this.hexDigits.charAt(15 & t)
								}, e.prototype.hexDump = function(t, e, i) {
									for(var r = "", s = t; e > s; ++s)
										if(r += this.hexByte(this.get(s)), i !== !0) switch(15 & s) {
											case 7:
												r += "  ";
												break;
											case 15:
												r += "\n";
												break;
											default:
												r += " "
										}
									return r
								}, e.prototype.parseStringISO = function(t, e) {
									for(var i = "", r = t; e > r; ++r) i += String.fromCharCode(this.get(r));
									return i
								}, e.prototype.parseStringUTF = function(t, e) {
									for(var i = "", r = t; e > r;) {
										var s = this.get(r++);
										i += 128 > s ? String.fromCharCode(s) : s > 191 && 224 > s ? String.fromCharCode((31 & s) << 6 | 63 & this.get(r++)) : String.fromCharCode((15 & s) << 12 | (63 & this.get(r++)) << 6 | 63 & this.get(r++))
									}
									return i
								}, e.prototype.parseStringBMP = function(t, e) {
									for(var i = "", r = t; e > r; r += 2) {
										var s = this.get(r),
											n = this.get(r + 1);
										i += String.fromCharCode((s << 8) + n)
									}
									return i
								}, e.prototype.reTime = /^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, e.prototype.parseTime = function(t, e) {
									var i = this.parseStringISO(t, e),
										r = this.reTime.exec(i);
									return r ? (i = r[1] + "-" + r[2] + "-" + r[3] + " " + r[4], r[5] && (i += ":" + r[5], r[6] && (i += ":" + r[6], r[7] && (i += "." + r[7]))), r[8] && (i += " UTC", "Z" != r[8] && (i += r[8], r[9] && (i += ":" + r[9]))), i) : "Unrecognized time: " + i
								}, e.prototype.parseInteger = function(t, e) {
									var i = e - t;
									if(i > 4) {
										i <<= 3;
										var r = this.get(t);
										if(0 === r) i -= 8;
										else
											for(; 128 > r;) r <<= 1, --i;
										return "(" + i + " bit)"
									}
									for(var s = 0, n = t; e > n; ++n) s = s << 8 | this.get(n);
									return s
								}, e.prototype.parseBitString = function(t, e) {
									var i = this.get(t),
										r = (e - t - 1 << 3) - i,
										s = "(" + r + " bit)";
									if(20 >= r) {
										var n = i;
										s += " ";
										for(var o = e - 1; o > t; --o) {
											for(var h = this.get(o), a = n; 8 > a; ++a) s += h >> a & 1 ? "1" : "0";
											n = 0
										}
									}
									return s
								}, e.prototype.parseOctetString = function(t, e) {
									var i = e - t,
										n = "(" + i + " byte) ";
									i > r && (e = t + r);
									for(var o = t; e > o; ++o) n += this.hexByte(this.get(o));
									return i > r && (n += s), n
								}, e.prototype.parseOID = function(t, e) {
									for(var i = "", r = 0, s = 0, n = t; e > n; ++n) {
										var o = this.get(n);
										if(r = r << 7 | 127 & o, s += 7, !(128 & o)) {
											if("" === i) {
												var h = 80 > r ? 40 > r ? 0 : 1 : 2;
												i = h + "." + (r - 40 * h)
											} else i += "." + (s >= 31 ? "bigint" : r);
											r = s = 0
										}
									}
									return i
								}, i.prototype.typeName = function() {
									if(this.tag === t) return "unknown";
									var e = this.tag >> 6,
										i = (this.tag >> 5 & 1, 31 & this.tag);
									switch(e) {
										case 0:
											switch(i) {
												case 0:
													return "EOC";
												case 1:
													return "BOOLEAN";
												case 2:
													return "INTEGER";
												case 3:
													return "BIT_STRING";
												case 4:
													return "OCTET_STRING";
												case 5:
													return "NULL";
												case 6:
													return "OBJECT_IDENTIFIER";
												case 7:
													return "ObjectDescriptor";
												case 8:
													return "EXTERNAL";
												case 9:
													return "REAL";
												case 10:
													return "ENUMERATED";
												case 11:
													return "EMBEDDED_PDV";
												case 12:
													return "UTF8String";
												case 16:
													return "SEQUENCE";
												case 17:
													return "SET";
												case 18:
													return "NumericString";
												case 19:
													return "PrintableString";
												case 20:
													return "TeletexString";
												case 21:
													return "VideotexString";
												case 22:
													return "IA5String";
												case 23:
													return "UTCTime";
												case 24:
													return "GeneralizedTime";
												case 25:
													return "GraphicString";
												case 26:
													return "VisibleString";
												case 27:
													return "GeneralString";
												case 28:
													return "UniversalString";
												case 30:
													return "BMPString";
												default:
													return "Universal_" + i.toString(16)
											}
										case 1:
											return "Application_" + i.toString(16);
										case 2:
											return "[" + i + "]";
										case 3:
											return "Private_" + i.toString(16)
									}
								}, i.prototype.reSeemsASCII = /^[ -~]+$/, i.prototype.content = function() {
									if(this.tag === t) return null;
									var e = this.tag >> 6,
										i = 31 & this.tag,
										n = this.posContent(),
										o = Math.abs(this.length);
									if(0 !== e) {
										if(null !== this.sub) return "(" + this.sub.length + " elem)";
										var h = this.stream.parseStringISO(n, n + Math.min(o, r));
										return this.reSeemsASCII.test(h) ? h.substring(0, 2 * r) + (h.length > 2 * r ? s : "") : this.stream.parseOctetString(n, n + o)
									}
									switch(i) {
										case 1:
											return 0 === this.stream.get(n) ? "false" : "true";
										case 2:
											return this.stream.parseInteger(n, n + o);
										case 3:
											return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(n, n + o);
										case 4:
											return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(n, n + o);
										case 6:
											return this.stream.parseOID(n, n + o);
										case 16:
										case 17:
											return "(" + this.sub.length + " elem)";
										case 12:
											return this.stream.parseStringUTF(n, n + o);
										case 18:
										case 19:
										case 20:
										case 21:
										case 22:
										case 26:
											return this.stream.parseStringISO(n, n + o);
										case 30:
											return this.stream.parseStringBMP(n, n + o);
										case 23:
										case 24:
											return this.stream.parseTime(n, n + o)
									}
									return null
								}, i.prototype.toString = function() {
									return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]"
								}, i.prototype.print = function(e) {
									if(e === t && (e = ""), document.writeln(e + this), null !== this.sub) {
										e += "  ";
										for(var i = 0, r = this.sub.length; r > i; ++i) this.sub[i].print(e)
									}
								}, i.prototype.toPrettyString = function(e) {
									e === t && (e = "");
									var i = e + this.typeName() + " @" + this.stream.pos;
									if(this.length >= 0 && (i += "+"), i += this.length, 32 & this.tag ? i += " (constructed)" : 3 != this.tag && 4 != this.tag || null === this.sub || (i += " (encapsulates)"), i += "\n", null !== this.sub) {
										e += "  ";
										for(var r = 0, s = this.sub.length; s > r; ++r) i += this.sub[r].toPrettyString(e)
									}
									return i
								}, i.prototype.toDOM = function() {
									var t = n.tag("div", "node");
									t.asn1 = this;
									var e = n.tag("div", "head"),
										i = this.typeName().replace(/_/g, " ");
									e.innerHTML = i;
									var r = this.content();
									if(null !== r) {
										r = String(r).replace(/</g, "&lt;");
										var s = n.tag("span", "preview");
										s.appendChild(n.text(r)), e.appendChild(s)
									}
									t.appendChild(e), this.node = t, this.head = e;
									var o = n.tag("div", "value");
									if(i = "Offset: " + this.stream.pos + "<br/>", i += "Length: " + this.header + "+", i += this.length >= 0 ? this.length : -this.length + " (undefined)", 32 & this.tag ? i += "<br/>(constructed)" : 3 != this.tag && 4 != this.tag || null === this.sub || (i += "<br/>(encapsulates)"), null !== r && (i += "<br/>Value:<br/><b>" + r + "</b>", "object" == typeof oids && 6 == this.tag)) {
										var h = oids[r];
										h && (h.d && (i += "<br/>" + h.d), h.c && (i += "<br/>" + h.c), h.w && (i += "<br/>(warning!)"))
									}
									o.innerHTML = i, t.appendChild(o);
									var a = n.tag("div", "sub");
									if(null !== this.sub)
										for(var u = 0, c = this.sub.length; c > u; ++u) a.appendChild(this.sub[u].toDOM());
									return t.appendChild(a), e.onclick = function() {
										t.className = "node collapsed" == t.className ? "node" : "node collapsed"
									}, t
								}, i.prototype.posStart = function() {
									return this.stream.pos
								}, i.prototype.posContent = function() {
									return this.stream.pos + this.header
								}, i.prototype.posEnd = function() {
									return this.stream.pos + this.header + Math.abs(this.length)
								}, i.prototype.fakeHover = function(t) {
									this.node.className += " hover", t && (this.head.className += " hover")
								}, i.prototype.fakeOut = function(t) {
									var e = / ?hover/;
									this.node.className = this.node.className.replace(e, ""), t && (this.head.className = this.head.className.replace(e, ""))
								}, i.prototype.toHexDOM_sub = function(t, e, i, r, s) {
									if(!(r >= s)) {
										var o = n.tag("span", e);
										o.appendChild(n.text(i.hexDump(r, s))), t.appendChild(o)
									}
								}, i.prototype.toHexDOM = function(e) {
									var i = n.tag("span", "hex");
									if(e === t && (e = i), this.head.hexNode = i, this.head.onmouseover = function() {
											this.hexNode.className = "hexCurrent"
										}, this.head.onmouseout = function() {
											this.hexNode.className = "hex"
										}, i.asn1 = this, i.onmouseover = function() {
											var t = !e.selected;
											t && (e.selected = this.asn1, this.className = "hexCurrent"), this.asn1.fakeHover(t)
										}, i.onmouseout = function() {
											var t = e.selected == this.asn1;
											this.asn1.fakeOut(t), t && (e.selected = null, this.className = "hex")
										}, this.toHexDOM_sub(i, "tag", this.stream, this.posStart(), this.posStart() + 1), this.toHexDOM_sub(i, this.length >= 0 ? "dlen" : "ulen", this.stream, this.posStart() + 1, this.posContent()), null === this.sub) i.appendChild(n.text(this.stream.hexDump(this.posContent(), this.posEnd())));
									else if(this.sub.length > 0) {
										var r = this.sub[0],
											s = this.sub[this.sub.length - 1];
										this.toHexDOM_sub(i, "intro", this.stream, this.posContent(), r.posStart());
										for(var o = 0, h = this.sub.length; h > o; ++o) i.appendChild(this.sub[o].toHexDOM(e));
										this.toHexDOM_sub(i, "outro", this.stream, s.posEnd(), this.posEnd())
									}
									return i
								}, i.prototype.toHexString = function() {
									return this.stream.hexDump(this.posStart(), this.posEnd(), !0)
								}, i.decodeLength = function(t) {
									var e = t.get(),
										i = 127 & e;
									if(i == e) return i;
									if(i > 3) throw "Length over 24 bits not supported at position " + (t.pos - 1);
									if(0 === i) return -1;
									e = 0;
									for(var r = 0; i > r; ++r) e = e << 8 | t.get();
									return e
								}, i.hasContent = function(t, r, s) {
									if(32 & t) return !0;
									if(3 > t || t > 4) return !1;
									var n = new e(s);
									3 == t && n.get();
									var o = n.get();
									if(o >> 6 & 1) return !1;
									try {
										var h = i.decodeLength(n);
										return n.pos - s.pos + h == r
									} catch(a) {
										return !1
									}
								}, i.decode = function(t) {
									t instanceof e || (t = new e(t, 0));
									var r = new e(t),
										s = t.get(),
										n = i.decodeLength(t),
										o = t.pos - r.pos,
										h = null;
									if(i.hasContent(s, n, t)) {
										var a = t.pos;
										if(3 == s && t.get(), h = [], n >= 0) {
											for(var u = a + n; t.pos < u;) h[h.length] = i.decode(t);
											if(t.pos != u) throw "Content size is not correct for container starting at offset " + a
										} else try {
											for(;;) {
												var c = i.decode(t);
												if(0 === c.tag) break;
												h[h.length] = c
											}
											n = a - t.pos
										} catch(f) {
											throw "Exception while decoding undefined length content: " + f
										}
									} else t.pos += n;
									return new i(r, o, n, s, h)
								}, i.test = function() {
									for(var t = [{
											value: [39],
											expected: 39
										}, {
											value: [129, 201],
											expected: 201
										}, {
											value: [131, 254, 220, 186],
											expected: 16702650
										}], r = 0, s = t.length; s > r; ++r) {
										var n = new e(t[r].value, 0),
											o = i.decodeLength(n);
										o != t[r].expected && document.write("In test[" + r + "] expected " + t[r].expected + " got " + o + "\n")
									}
								}, window.ASN1 = i
							}(), ASN1.prototype.getHexStringValue = function() {
								var t = this.toHexString(),
									e = 2 * this.header,
									i = 2 * this.length;
								return t.substr(e, i)
							}, pi.prototype.parseKey = function(t) {
								try {
									var e = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,
										i = e.test(t) ? Hex.decode(t) : Base64.unarmor(t),
										r = ASN1.decode(i);
									if(9 === r.sub.length) {
										var s = r.sub[1].getHexStringValue();
										this.n = ci(s, 16);
										var n = r.sub[2].getHexStringValue();
										this.e = parseInt(n, 16);
										var o = r.sub[3].getHexStringValue();
										this.d = ci(o, 16);
										var h = r.sub[4].getHexStringValue();
										this.p = ci(h, 16);
										var a = r.sub[5].getHexStringValue();
										this.q = ci(a, 16);
										var u = r.sub[6].getHexStringValue();
										this.dmp1 = ci(u, 16);
										var c = r.sub[7].getHexStringValue();
										this.dmq1 = ci(c, 16);
										var f = r.sub[8].getHexStringValue();
										this.coeff = ci(f, 16)
									} else {
										if(2 !== r.sub.length) return !1;
										var p = r.sub[1],
											l = p.sub[0],
											s = l.sub[0].getHexStringValue();
										this.n = ci(s, 16);
										var n = l.sub[1].getHexStringValue();
										this.e = parseInt(n, 16)
									}
									return !0
								} catch(d) {
									return !1
								}
							}, pi.prototype.getPrivateBaseKey = function() {
								var t = {
										array: [new KJUR.asn1.DERInteger({
											"int": 0
										}), new KJUR.asn1.DERInteger({
											bigint: this.n
										}), new KJUR.asn1.DERInteger({
											"int": this.e
										}), new KJUR.asn1.DERInteger({
											bigint: this.d
										}), new KJUR.asn1.DERInteger({
											bigint: this.p
										}), new KJUR.asn1.DERInteger({
											bigint: this.q
										}), new KJUR.asn1.DERInteger({
											bigint: this.dmp1
										}), new KJUR.asn1.DERInteger({
											bigint: this.dmq1
										}), new KJUR.asn1.DERInteger({
											bigint: this.coeff
										})]
									},
									e = new KJUR.asn1.DERSequence(t);
								return e.getEncodedHex()
							}, pi.prototype.getPrivateBaseKeyB64 = function() {
								return Ri(this.getPrivateBaseKey())
							}, pi.prototype.getPublicBaseKey = function() {
								var t = {
										array: [new KJUR.asn1.DERObjectIdentifier({
											oid: "1.2.840.113549.1.1.1"
										}), new KJUR.asn1.DERNull]
									},
									e = new KJUR.asn1.DERSequence(t);
								t = {
									array: [new KJUR.asn1.DERInteger({
										bigint: this.n
									}), new KJUR.asn1.DERInteger({
										"int": this.e
									})]
								};
								var i = new KJUR.asn1.DERSequence(t);
								t = {
									hex: "00" + i.getEncodedHex()
								};
								var r = new KJUR.asn1.DERBitString(t);
								t = {
									array: [e, r]
								};
								var s = new KJUR.asn1.DERSequence(t);
								return s.getEncodedHex()
							}, pi.prototype.getPublicBaseKeyB64 = function() {
								return Ri(this.getPublicBaseKey())
							}, pi.prototype.wordwrap = function(t, e) {
								if(e = e || 64, !t) return t;
								var i = "(.{1," + e + "})( +|$\n?)|(.{1," + e + "})";
								return t.match(RegExp(i, "g")).join("\n")
							}, pi.prototype.getPrivateKey = function() {
								var t = "-----BEGIN RSA PRIVATE KEY-----\n";
								return t += this.wordwrap(this.getPrivateBaseKeyB64()) + "\n", t += "-----END RSA PRIVATE KEY-----"
							}, pi.prototype.getPublicKey = function() {
								var t = "-----BEGIN PUBLIC KEY-----\n";
								return t += this.wordwrap(this.getPublicBaseKeyB64()) + "\n", t += "-----END PUBLIC KEY-----"
							}, pi.prototype.hasPublicKeyProperty = function(t) {
								return t = t || {}, t.hasOwnProperty("n") && t.hasOwnProperty("e")
							}, pi.prototype.hasPrivateKeyProperty = function(t) {
								return t = t || {}, t.hasOwnProperty("n") && t.hasOwnProperty("e") && t.hasOwnProperty("d") && t.hasOwnProperty("p") && t.hasOwnProperty("q") && t.hasOwnProperty("dmp1") && t.hasOwnProperty("dmq1") && t.hasOwnProperty("coeff")
							}, pi.prototype.parsePropertiesFrom = function(t) {
								this.n = t.n, this.e = t.e, t.hasOwnProperty("d") && (this.d = t.d, this.p = t.p, this.q = t.q, this.dmp1 = t.dmp1, this.dmq1 = t.dmq1, this.coeff = t.coeff)
							};
						var Zi = function(t) {
							pi.call(this), t && ("string" == typeof t ? this.parseKey(t) : (this.hasPrivateKeyProperty(t) || this.hasPublicKeyProperty(t)) && this.parsePropertiesFrom(t))
						};
						Zi.prototype = new pi, Zi.prototype.constructor = Zi;
						var Gi = function(t) {
							t = t || {}, this.default_key_size = parseInt(t.default_key_size) || 1024, this.default_public_exponent = t.default_public_exponent || "010001", this.log = t.log || !1, this.key = null
						};
						Gi.prototype.setKey = function(t) {
							this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new Zi(t)
						}, Gi.prototype.setPrivateKey = function(t) {
							this.setKey(t)
						}, Gi.prototype.setPublicKey = function(t) {
							this.setKey(t)
						}, Gi.prototype.decrypt = function(t) {
							try {
								return this.getKey().decrypt(Ei(t))
							} catch(e) {
								return !1
							}
						}, Gi.prototype.encrypt = function(t) {
							try {
								return Ri(this.getKey().encrypt(t))
							} catch(e) {
								return console.log(arguments), !1
							}
						}, Gi.prototype.getKey = function(t) {
							if(!this.key) {
								if(this.key = new Zi, t && "[object Function]" === {}.toString.call(t)) return this.key.generateAsync(this.default_key_size, this.default_public_exponent, t), void 0;
								this.key.generate(this.default_key_size, this.default_public_exponent)
							}
							return this.key
						}, Gi.prototype.getPrivateKey = function() {
							return this.getKey().getPrivateKey()
						}, Gi.prototype.getPrivateKeyB64 = function() {
							return this.getKey().getPrivateBaseKeyB64()
						}, Gi.prototype.getPublicKey = function() {
							return this.getKey().getPublicKey()
						}, Gi.prototype.getPublicKeyB64 = function() {
							return this.getKey().getPublicBaseKeyB64()
						}, t.JSEncrypt = Gi
					}(e.RSA), e.RSA = e.RSA.JSEncrypt
			}
		}
	})
}();
_.Module.define({
	path: "encourage-payment/widget/paykey_safe_payment",
	requires: ["encourage-payment/widget/rsa_safe"],
	sub: {
		ERROR: {
			2270018: "",
			1990005: "\u652f\u4ed8\u5bc6\u7801\u9a8c\u8bc1\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\uff0c\u60a8\u8fd8\u6709{#NUM#}\u6b21\u8f93\u5165\u673a\u4f1a",
			2190005: '\u4f60\u5df2\u8f93\u5165\u5bc6\u7801\u9519\u8bef5\u6b21\uff0c\u652f\u4ed8\u5bc6\u7801\u88ab\u9501\u5b9a\uff0c\u8bf7<a target="_blank" href="/tbmall/pass/set">\u627e\u56de\u5bc6\u7801</a>'
		},
		MAX_ERR_TIME: 5,
		_setTpl: ['<div id="paykey_set_dialog" class="paykey_set_dialog clearfix">', "<p>\u8bf7\u8bbe\u7f6e\u652f\u4ed8\u5bc6\u7801\u540e\u5b8c\u6210\u6d88\u8d39</br>\uff08\u53ef\u964d\u4f4eT\u8c46\u88ab\u76d7\u98ce\u9669\uff0c\u4fdd\u969c\u8d22\u4ea7\u5b89\u5168\uff09</p>", '<div class="paykey_btn_area clearfix">', '<a href="/tbmall/pass/set" target="_blank" class="paykey_set_accept_btn paykey_set_btn" id="paykey_set_accept_btn">\u7acb\u5373\u8bbe\u7f6e</a>', '<a href="#" class="paykey_set_cancel_btn paykey_set_btn" id="paykey_set_cancel_btn">\u4e0b\u6b21\u518d\u8bf4</a>', "</div>", "</div>"].join(""),
		_inputTpl: ['<div id="paykey_set_dialog" class="paykey_set_dialog clearfix">', '<form id="paykey_set_form">', '<div class="paykey_input_area">', "<span>\u8bf7\u8f93\u5165\u652f\u4ed8\u5bc6\u7801</span>", '<input type="password" class="j_paykey_input paykey_input" id="paykey_input"/>', '<p id="paykey_input_msg" class="paykey_input_msg">{#ERROR#}</p>', "</div>", '<div class="paykey_btn_area clearfix">', '<a class="j_paykey_submit_btn paykey_submit_btn paykey_set_btn" id="paykey_submit_btn">\u63d0\u4ea4</a>', '<a href="/tbmall/pass/set" target="_blank" class="j_paykey_cancel_btn  paykey_set_btn" id="paykey_cancel_btn">\u5fd8\u8bb0\u5bc6\u7801</a>', "</div>", "</form>", "</div>"].join(""),
		_dialog: null,
		conf: {},
		initial: function(e) {
			this.conf = $.extend(this.conf, e), this.RSA = this.requireInstance("encourage-payment/widget/rsa_safe")
		},
		showDialog: function(e, a, t) {
			var i = a;
			2 == arguments.length && (t = a, i = null), 2 === this.conf.showType ? this.inputPasskeyDialog(e, i, t) : 1 === this.conf.showType ? this.setPasskeyDialog(e, i, t) : "function" == typeof e && (t ? e.call(t) : e())
		},
		inputPasskeyDialog: function(e, a, t) {
			var i = this;
			2 == arguments.length && (t = a);
			var s = this._inputTpl;
			if(this.conf.errType && (s = s.replace("{#ERROR#}", this.ERROR[this.conf.errType])), this.conf.errTime) {
				var n = this.MAX_ERR_TIME - this.conf.errTime;
				s = s.replace("{#NUM#}", n)
			}
			this._dialog = new $.dialog({
				html: s,
				title: "\u652f\u4ed8\u5bc6\u7801",
				draggable: !1,
				width: 420
			});
			var _ = function() {
				var a = $("#paykey_input").val();
				if(!a) return $("#paykey_input_msg").text("\u8bf7\u8f93\u5165\u652f\u4ed8\u5bc6\u7801"), void 0;
				var s = i.RSA.vcode(a);
				"function" == typeof e && (t ? e.call(t, {
					password: s
				}) : e({
					password: s
				})), i._dialog.close()
			};
			$("#paykey_submit_btn").click(function(e) {
				e.preventDefault(), _()
			}), $("#paykey_set_form").submit(function(e) {
				e.preventDefault(), _()
			}), this._dialog.onclose(function() {
				"function" == typeof a && (t ? a.call(t) : a())
			})
		},
		setPasskeyDialog: function(e, a, t) {
			var i = this;
			2 == arguments.length && (t = a), this._dialog = new $.dialog({
				html: this._setTpl,
				title: "\u63d0\u793a",
				draggable: !1,
				width: 420
			}), $("#paykey_set_accept_btn").click(function() {
				i._dialog.close()
			}), $("#paykey_set_cancel_btn").click(function() {
				i._dialog.close()
			}), this._dialog.element.find(".dialogJclose").on("click", function() {
				"function" == typeof a && (t ? a.call(t, {
					ignore_set_paypass: 1
				}) : a({
					ignore_set_paypass: 1
				}))
			})
		}
	}
});
_.Module.define({
	path: "tbui/widget/captcha",
	sub: {
		ERROR_MESSAGES: {
			38: "\u9a8c\u8bc1\u7801\u8f93\u5165\u8d85\u65f6\uff0c\u8bf7\u60a8\u91cd\u65b0\u8f93\u5165",
			37: "\u9a8c\u8bc1\u7801\u8f93\u5165\u5931\u6548\uff0c\u8bf7\u60a8\u91cd\u65b0\u8f93\u5165",
			40: "\u9a8c\u8bc1\u7801\u8f93\u5165\u9519\u8bef\uff0c\u8bf7\u60a8\u91cd\u65b0\u8f93\u5165"
		},
		DEFAULT_OPTIONS: {
			imgUrl: "/cgi-bin/genimg?",
			audioUrl: "/cgi-bin/genaudio?",
			checkUrl: "/f/commit/commonapi/checkVcode",
			vCodeUrl: "/f/commit/commonapi/getVcode",
			inputFocusClass: "c_captcha_focus",
			postType: "thread",
			isAnonymous: !1,
			template: '<div class="tbui_captcha_component tbui_captcha_normal"><div class="tbui_captcha_tip j_captcha_tip"></div><div><span class="tbui_captcha_title">\u9a8c\u8bc1\u7801</span><span class="tbui_captcha_input_wrap"><input autocomplete="off" size="10" maxlength="4" class="j_captcha_input" ><span class="tbui_captcha_status j_captcha_status"></span></span><span class="j_captcha_content"><span class="tbui_captcha_img_wrap j_captcha_img_wrapper"></span><span class="tbui_captcha_buttons"><a class="j_captcha_img_change">\u770b\u4e0d\u6e05?</a>&nbsp;<a class="c_captcha_a_audio j_captcha_audio_switch" >\u6536\u542c\u9a8c\u8bc1\u7801</a></span><span><img class="j_captcha_audio_icon" src="//tieba.baidu.com/tb/img/audio.gif" style="display:none;" /><span class="j_captcha_audio_wrapper"></span></span></span></div><div class="tbui_captcha_error j_captcha_err"></div><div class="tbui_captcha_info j_captcha_info"></div></div>',
			gridTemplate: '<div class="tbui_captcha_component tbui_captcha_grid"><div class="tbui_captcha_tip j_captcha_tip"></div><div class="tbui_captcha_grid_head clearfix"><div class="tbui_captcha_title">\u9a8c\u8bc1\u7801</div><div class="tbui_captcha_input_wrap"><div class="j_captcha_input tbui_captcha_grid_input"><div></div><div></div><div></div><div></div><div class="tbui_captcha_backspace j_captcha_backspace"></div></div><div class="tbui_captcha_status j_captcha_status"></div></div></div><div class="tbui_captcha_grid_content"><div><span class="tbui_captcha_img_wrap j_captcha_img_wrapper"></span><span class="tbui_captcha_buttons"><a class="j_captcha_img_change">\u770b\u4e0d\u6e05?</a></span></div><div class="tbui_captcha_error j_captcha_err"></div><div class="tbui_captcha_help j_captcha_help">\u70b9\u51fb\u6846\u5185\u6587\u5b57\u8f93\u5165\u4e0a\u56fe\u4e2d<span class="ui_text_emphasize">\u6c49\u5b57\u6216\u62fc\u97f3</span>\u5bf9\u5e94\u6c49\u5b57</div><div class="tbui_captcha_grid_buttons clearfix j_captcha_buttons"><a href="#" tabindex="0"><div class="tbui_captcha_btn_0"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_1"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_2"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_3"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_4"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_5"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_6"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_7"></div></a><a href="#" tabindex="0"><div class="tbui_captcha_btn_8"></div></a></div><div class="tbui_captcha_info j_captcha_info"></div></div></div>'
		},
		gridStyleSheetTpl: ".tbui_captcha_grid_input div, .tbui_captcha_grid_content .tbui_captcha_img_wrap, .tbui_captcha_grid_buttons div {background: url('#{imgSrc}') -500px -500px/145px 180px no-repeat;}",
		gridPosition: {
			0: "-3px -41px",
			1: "-56px -41px",
			2: "-100px -41px",
			3: "-3px -90px",
			4: "-56px -90px",
			5: "-100px -90px",
			6: "-3px -138px",
			7: "-56px -138px",
			8: "-100px -138px"
		},
		gridKeyMap: {
			0: "00000000",
			1: "00010000",
			2: "00020000",
			3: "00000001",
			4: "00010001",
			5: "00020001",
			6: "00000002",
			7: "00010002",
			8: "00020002"
		},
		initial: function(t) {
			$.browser.msie && 6 == $.browser.version && document.execCommand("BackgroundImageCache", !1, !0);
			var a = this;
			this.options = t, this.options = $.extend({}, this.DEFAULT_OPTIONS, t), this.$container = $(this.options.container);
			var i;
			i = 4 == t.vCodeType ? $(this.options.gridTemplate) : $(this.options.template), this.$input = i.find(".j_captcha_input"), this.$tip = i.find(".j_captcha_tip"), this.$error = i.find(".j_captcha_err"), this.$status = i.find(".j_captcha_status"), this.$imgWrapper = i.find(".j_captcha_img_wrapper"), this.$imgChangeBtn = i.find(".j_captcha_img_change"), this.$switchAudioBtn = i.find(".j_captcha_audio_switch"), this.$info = i.find(".j_captcha_info"), this.$imgChangeBtn.add(this.$imgWrapper).click(function() {
				return a.reloadCaptchaImg(), !1
			}), 4 == t.vCodeType ? this._initGridCaptcha(i) : this._initNormalCaptcha(i), this.options.message && this.setTip(this.options.message), this.updateCaptchaImg(this.options.vCode, this.options.vCodeType), this.options.exceptionalAccount && this.$tip.html('\u60a8\u5728\u5168\u5427\u53d1\u8d34\u65f6\u4f1a\u9047\u5230\u9a8c\u8bc1\u7801\uff0c<a target="_blank" href="//tieba.baidu.com/pmc/main" class="ui_text_link">\u70b9\u51fb\u89e3\u9664</a>'), this.$container.append(i), this.$root = i
		},
		_initNormalCaptcha: function(t) {
			var a = this;
			this.$audioIcon = t.find(".j_captcha_audio_icon"), this.$audioWrapper = t.find(".j_captcha_audio_wrapper"), this.$switchAudioBtn.click(function() {
				return a.loadAudio(), !1
			}), this.$input.focus(function() {
				$(this).addClass(a.options.inputFocusClass)
			}).blur(function() {
				$(this).removeClass(a.options.inputFocusClass)
			}).keyup(function(t) {
				13 == t.which ? a.trigger("captcha_submit") : 1 == a.vCodeType ? /^[\u4e00-\u9fa5]+$/.test(this.value) && 4 == this.value.length && (a.setReadonlyState(!0), a.checkCaptcha()) : 4 == this.value.length ? a.checkCaptcha() : a.getStatus() && a.setStatus(!1)
			})
		},
		_initGridCaptcha: function(t) {
			var a = this;
			a.$help = t.find(".j_captcha_help"), a.inputValue = "", a.$inputGrid = a.$input.children(), t.find(".j_captcha_backspace").click(function() {
				a.backspace()
			}), t.find(".j_captcha_buttons").on("click", "a", function(t) {
				t.preventDefault(), t.stopPropagation();
				var i = a.inputValue.length;
				if(4 > i) {
					var s = $(this),
						c = s.index();
					a.$inputGrid.eq(i).css("background-position", a.gridPosition[c]), a.inputValue += c, 4 == a.inputValue.length && a.checkCaptcha(function(t) {
						0 === t.anti_valve_err_no ? setTimeout(function() {
							a.trigger("captcha_submit")
						}, 500) : 4 == a.vCodeType && a.reloadCaptchaImg()
					})
				}
			}), t.keydown(function(t) {
				return t.preventDefault(), t.stopPropagation(), 8 == t.which && a.backspace(), !1
			}), t.keyup(function(t) {
				return t.preventDefault(), t.stopPropagation(), !1
			}), t.keypress(function(t) {
				return t.preventDefault(), t.stopPropagation(), !1
			})
		},
		getVCode: function() {
			return this.vCode
		},
		getVCodeType: function() {
			return this.vCodeType
		},
		setVCodeType: function(t) {
			this.vCodeType = t, 0 != t ? this.$switchAudioBtn.hide() : this.$switchAudioBtn.show()
		},
		setStatus: function(t) {
			this.isValid = t, t ? (this.$status.addClass("tbui_captcha_correct"), this.setError("")) : t === !1 ? this.$status.removeClass("tbui_captcha_correct") : (this.$status.removeClass("tbui_captcha_correct"), this.setError(""))
		},
		setReadonlyState: function(t) {
			t ? this.$input.prop("disabled", "disabled").addClass("captcha_input_readonly") : this.$input.prop("disabled", !1).removeClass("captcha_input_readonly")
		},
		getStatus: function() {
			return this.isValid
		},
		setTip: function(t) {
			this.$tip.text(t)
		},
		setError: function(t) {
			4 == this.vCodeType && ("" == t ? (this.$error.hide(), this.$help.show()) : (this.$help.hide(), this.$error.show())), this.$error.text(t)
		},
		updateCaptchaImg: function(t, a) {
			this.setStatus(void 0), a && this.setVCodeType(a), this.vCode = t, 4 == this.vCodeType ? this._updateGridCaptchaImg() : this._updateNormalCaptchaImg()
		},
		_updateNormalCaptchaImg: function() {
			this.$input.val("").focus();
			var t = this.options.imgUrl + this.vCode + "&t=" + Math.random();
			this.$img ? this.$img.tbattr("src", t) : this.$img = $('<img src="' + t + '" />').appendTo(this.$imgWrapper)
		},
		_updateGridCaptchaImg: function() {
			this.inputValue = "", this.$inputGrid.each(function() {
				$(this).tbattr("style", "")
			});
			var t = this.options.imgUrl + this.vCode + "&tag=pc&t=" + Math.random();
			this.captchaStyleSheet || (this.captchaStyleSheet = $("<style type='text/css'></style>").appendTo("head")[0]);
			var a = $.tb.format(this.gridStyleSheetTpl, {
				imgSrc: t
			});
			this.captchaStyleSheet.styleSheet ? this.captchaStyleSheet.styleSheet.cssText = a : this.captchaStyleSheet.innerHTML = a
		},
		reloadCaptchaImg: function(t) {
			t = t || {};
			var a = this,
				i = this.options.paramsCallback ? this.options.paramsCallback() : {};
			$.extend(i, {
				lm: this.options.forumId,
				word: this.options.forumName,
				rs10: "thread" == this.options.postType ? "1" : "0",
				rs1: this.options.isAnonymous ? "1" : "0",
				t: Math.random()
			}), 4 == this.vCodeType && (i.tag = 11), $.ajax({
				url: a.options.vCodeUrl,
				data: i,
				success: function(i) {
					a.setReadonlyState(!1), i.need_vcode ? 4 == i.captcha_code_type && 4 != a.vCodeType || 4 != i.captcha_code_type && 4 == a.vCodeType ? a.trigger("captcha_type_change", i.captcha_vcode_str, i.captcha_code_type) : (a.setTip(i.str_reason), a.setError(t.error || ""), a.updateCaptchaImg(i.captcha_vcode_str, i.captcha_code_type)) : console.log("Captcha#reloadCaptchaImg: \u7406\u8bba\u4e0a\u4e0d\u5e94\u8be5\u770b\u5230\u8be5\u5206\u652f"), t.success && t.success.call(this)
				},
				type: "post",
				dataType: "json"
			})
		},
		loadAudio: function() {
			this.$audioIcon.show();
			var t = this.options.audioUrl + this.vCode + "&t=" + Math.random();
			document.all ? this.$audioWrapper.html('<object height=0 width=0 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6><param name="AutoStart" value="1"><param NAME="url" value="' + t + '"><param name="PlayCount" value="1">') : this.$audioWrapper.html('<embed src="' + t + '" name="MediaPlayer" type="video/x-ms-wmv" autostart="1" showcontrols="1" allowscan="1" playcount="1" enablecontextmenu="0" height="0" width="0"></object>'), this.$input.focus()
		},
		checkCaptcha: function(t) {
			var a = this,
				i = {
					captcha_vcode_str: this.vCode,
					captcha_code_type: this.vCodeType,
					captcha_input_str: this.getInputValue(),
					fid: this.options.forumId
				};
			$.post(this.options.checkUrl, i, function(i) {
				var s = i.anti_valve_err_no;
				0 === s ? (a.setStatus(!0), 4 !== a.vCodeType && setTimeout(function() {
					a.trigger("captcha_submit")
				}, 1e3)) : null === s || "" === s ? a.setStatus(void 0) : (a.setStatus(!1), a.setError(a.ERROR_MESSAGES[s]), a.ERROR_MESSAGES[s] && 4 !== a.vCodeType && setTimeout(function() {
					a.reloadCaptchaImg({
						error: a.ERROR_MESSAGES[s]
					})
				}, 1e3)), t && t(i)
			}, "json")
		},
		validate: function() {
			return 0 == this.getInputValue().length ? (this.setError("\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801"), this.focus(), !1) : this.isValid || void 0 === this.isValid
		},
		backspace: function() {
			if(4 == this.vCodeType) {
				var t = this.inputValue.length;
				this.$inputGrid.eq(t - 1).tbattr("style", ""), this.inputValue = this.inputValue.substring(0, t - 1)
			}
		},
		getInputValue: function() {
			if(4 == this.vCodeType) {
				for(var t = this.inputValue.split(""), a = [], i = 0, s = t.length; s > i; i++) a.push(this.gridKeyMap[t[i]]);
				return a.join("")
			}
			return this.$input.val().replace(/\s/g, "")
		},
		focus: function() {
			this.$input.focus()
		},
		clear: function() {
			this.$input.val("")
		},
		show: function() {
			this.$root.show()
		},
		hide: function() {
			this.$root.hide()
		}
	}
});
_.Module.define({
	path: "tbui/widget/captcha_dialog",
	requires: ["tbui/widget/captcha"],
	sub: {
		template: ["<div class='tbui_captcha_dialog'>", "<div class='tbui_captcha_container'></div>", '<div class="j_button_bar"></div>', "</div>"].join(""),
		initial: function(t) {
			var a, i = $(this.template);
			this.$content = i;
			var c = t.title || "\u53d1\u8868\u8d34\u5b50",
				h = "undefined" == typeof t.modal ? !0 : t.modal;
			this.options = t, t.container = i.find(".tbui_captcha_container"), this.normalCaptcha = null, this.gridCaptcha = null, this.captcha = this._initCaptchaInstance(t);
			var e = 540;
			4 == t.vCodeType ? (e = 360, this.gridCaptcha = this.captcha) : this.normalCaptcha = this.captcha, a = new $.dialog({
				title: c,
				width: e,
				html: i,
				modal: h
			});
			var n = i.find(".j_ok");
			4 == t.vCodeType && n.detach(), this._addFeedbackTip(), this.$okButton = n, this.dialog = a
		},
		_initCaptchaInstance: function(t) {
			var a = this,
				i = this.requireInstance("tbui/widget/captcha", t);
			return i.bind("captcha_submit", function() {
				a.accept()
			}), i.bind("captcha_type_change", function(t, i, c) {
				a.updateCaptchaImg(i, c)
			}), i
		},
		_addFeedbackTip: function() {
			var t = $.tb.location,
				a = t.getProtocol() + "//" + t.getHostname() + (t.getPort() ? ":" + t.getPort() : ""),
				i = a + "/f?ie=utf-8&kw=%E8%B4%B4%E5%90%A7%E6%84%8F%E8%A7%81%E5%8F%8D%E9%A6%88%E5%90%A7",
				c = $('<a href="' + i + '" class="captcha_feedback_tip" target="_blank">\u9a8c\u8bc1\u8fc7\u7a0b\u51fa\u73b0\u95ee\u9898\uff1f\u8bf7\u70b9\u6b64\u53cd\u9988</a>');
			this.$content.find(".j_button_bar").append(c)
		},
		bind: function() {
			this.dialog.bind.apply(this.dialog, arguments)
		},
		show: function() {
			this.dialog.show(), this.captcha.focus()
		},
		hide: function() {
			this.dialog.hide()
		},
		getInputValue: function() {
			return this.captcha.getInputValue()
		},
		setTip: function(t) {
			this.options.message = t, this.captcha.setTip(t)
		},
		getVCode: function() {
			return this.captcha.getVCode()
		},
		getVCodeType: function() {
			return this.captcha.getVCodeType()
		},
		updateCaptchaImg: function(t, a) {
			4 == a && a != this.captcha.getVCodeType() ? (null == this.gridCaptcha ? this.gridCaptcha = this._initCaptchaInstance($.extend(this.options, {
				vCode: t,
				vCodeType: a
			})) : this.gridCaptcha.updateCaptchaImg(t, a), this.captcha.hide(), this.gridCaptcha.show(), this.$okButton.detach(), this.captcha = this.gridCaptcha, this.dialog.width(360)) : 4 != a && 4 == this.captcha.getVCodeType() ? (null == this.normalCaptcha ? this.normalCaptcha = this._initCaptchaInstance($.extend(this.options, {
				vCode: t,
				vCodeType: a
			})) : this.normalCaptcha.updateCaptchaImg(t, a), this.captcha.hide(), this.normalCaptcha.show(), this.$content.find(".j_button_bar").append(this.$okButton), this.captcha = this.normalCaptcha, this.dialog.width(540)) : this.captcha.updateCaptchaImg(t, a)
		},
		reloadCaptchaImg: function(t) {
			this.captcha.reloadCaptchaImg(t)
		},
		focus: function() {
			this.captcha.focus()
		},
		clear: function() {
			this.captcha.clear()
		},
		accept: function() {
			this.captcha.validate() && (this.dialog.hide(), this.dialog.triggerHandler("onaccept"))
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/captcha_safe_payment",
	requires: ["tbui/widget/captcha_dialog"],
	sub: {
		initial: function(a) {
			this.reCommitUrl = a.url, this.data = a.data
		},
		showCaptcha: function(a, t) {
			var e = this,
				c = PageData.tbs || PageData.user.tbs,
				o = 2150040 == e.data.no ? "\u6b63\u786e\u8f93\u5165\u9a8c\u8bc1\u7801\u540e\uff0c\u53ef\u7ee7\u7eed\u8d2d\u4e70" : "\u9a8c\u8bc1\u7801\u8f93\u5165\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165",
				d = this.requireInstance("tbui/widget/captcha_dialog", {
					message: e.data.data.captcha_str_reason,
					vCode: e.data.data.captcha_vcode_str,
					vCodeType: e.data.data.captcha_code_type,
					exceptionalAccount: 0,
					title: "T\u8c46\u652f\u4ed8\u9a8c\u8bc1\u7801",
					message: o,
					forumName: "",
					modal: !0,
					forumId: 0,
					checkUrl: "/tbmall/vcode/safecheckvcode?tbs=" + c,
					vCodeUrl: "/tbmall/vcode/safegetvcode",
					paramsCallback: function() {
						return {
							tbs: c
						}
					}
				});
			d.bind("onclose", function() {
				d.hide(), $.tb.location.reload()
			}), d.bind("onaccept", function() {
				var e = {};
				e.captcha_input_str = d.getInputValue(), e.captcha_vcode_str = d.getVCode(), "function" == typeof a && (t ? a.call(t, e) : a(e))
			}), d.show()
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/mobile_safe_payment",
	requires: [],
	sub: {
		_conf: {
			token: "",
			type: "bind"
		},
		initial: function(e) {
			this._conf = $.extend(this._conf, e)
		},
		show: function(e, s, i, t) {
			"check" === this._conf.type ? this.showMobileCheck(e, s, i, t) : this.showMobileBind(e, s, i, t)
		},

		_setTpl: ['<a class="dialogJclose j_set_mobile_check_dialogJclose" title="\u5173\u95ed\u672c\u7a97\u53e3">&nbsp;</a>', '<div class="set_mobile_check_wrap" id="set_mobile_check_wrap">', '<div class="set_mobile_check_msg">', '<span class="set_mobile_check_icon"></span>', '<span class="set_mobile_check_title">\u64cd\u4f5c\u6210\u529f</span>', "</div>", "<p>\u4e3a\u4fdd\u969c\u8d26\u53f7T\u8c46\u5b89\u5168\uff0c\u5efa\u8bae\u60a8\u9009\u62e9\u5f00\u542f\u624b\u673a\u9a8c\u8bc1\u529f\u80fd</p>", '<div class="set_mobile_check_operator">', '<a href="#" class="set_mobile_check_select">', '<input type="radio" class="j_set_mobile_check_ok set_mobile_check_radio" name="set_mobile_check_radio" checked/>\u5355\u7b14T\u8c46\u6d88\u8d39\u8d85\u8fc7100000\u5f00\u542f\u624b\u673a\u9a8c\u8bc1\u529f\u80fd', "</a>", '<a href="#" class="set_mobile_check_select">', '<input type="radio" class="j_set_mobile_check_cancel set_mobile_check_radio" name="set_mobile_check_radio"/>\u4e0d\u5f00\u542f\u624b\u673a\u9a8c\u8bc1\u529f\u80fd', "</a>", '<a href="#" class="j_set_mobile_check_submit set_mobile_check_submit btn_default btn_middle"><span><em>\u786e\u5b9a</em></span></a>', "</div>", "</div>"].join(""),
		showSetMobileCheck: function(e, s, i) {
			var t = this,
				o = new $.dialog({
					html: this._setTpl,
					showTitle: !1,
					height: 260,
					width: 420
				}),
				n = $(o.element);
			t.openCheck = 1;
			var c = function() {
				$.ajax({
					url: "/tbmall/pass/setAuthPhone",
					type: "post",
					dataType: "json",
					data: {
						type: t.openCheck,
						tbs: PageData.tbs
					},
					success: function(e) {
						0 === e.no ? setTimeout(function() {
							o.close()
						}, 1e3) : $.dialog.alert("\u6d88\u8d39\u624b\u673a\u9a8c\u8bc1\u529f\u80fd\u8bbe\u7f6e\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5")
					},
					error: function() {
						$.dialog.alert("\u6d88\u8d39\u624b\u673a\u9a8c\u8bc1\u529f\u80fd\u8bbe\u7f6e\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5")
					}
				})
			};
			n.find(".j_set_mobile_check_submit").click(function() {
				c()
			}), n.find(".j_set_mobile_check_ok").click(function() {
				t.openCheck = 1
			}), n.find(".j_set_mobile_check_cancel").click(function() {
				t.openCheck = 0
			}), n.find(".j_set_mobile_check_dialogJclose").click(function() {
				t.openCheck = 1, c()
			}), o.onclose(function() {
				"function" == typeof s && s.call(i, e)
			})
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tbean_safe",
	requires: ["encourage-payment/widget/mobile_safe_payment", "encourage-payment/widget/captcha_safe_payment", "encourage-payment/widget/paykey_safe_payment"],
	sub: {
		ERROR: {},
		initial: function(t) {
			this._initParam(t), this._handleErr()
		},
		needCheck: function() {
			return !!this.type
		},
		getType: function() {
			return this.type
		},
		_initParam: function(t) {
			t = $.extend({
				json: {},
				sucCallback: function() {},
				errCallback: function() {}
			}, t), this.type = 0, this._json = t.json || {}, this._no = this._json.no || this._json.errno, this._msg = this._json.msg, this._data = this._json.data || {}, this._content = t.content, this._sucCall = $.isFunction(t.sucCallback) ? t.sucCallback : function() {}, this._errCall = $.isFunction(t.errCallback) ? t.errCallback : function() {}, this._mobileMsg = "undefined" != typeof t.tbeanOptions ? t.tbeanOptions.mobileMsg : ""
		},
		_handleErr: function() {
			switch(this._no) {
				case 360007:
				case 2150040:
					this._initCaptcha(), this.type = 1;
					break;
				case 2270018:
				case 1990005:
				case 2190005:
					this._initPaykey(2), this.type = 2;
					break;
				case 2270066:
					this._initPaykey(1), this.type = 2;
					break;
				case 2270040:
					this._initFirstMobile("bind"), this.type = 3;
					break;
				case 2270041:
					this._initMobile("bind"), this.type = 3;
					break;
				case 2270042:
					this._initMobile("check"), this.type = 3;
					break;
				case 2270072:
					this._initFrozen(), this.type = 4
			}
		},
		_initCaptcha: function() {
			var t = this.requireInstance("encourage-payment/widget/captcha_safe_payment", {
				data: this._json
			});
			t.showCaptcha(this._sucCall, this._content, this._errCall)
		},
		_initPaykey: function(t) {
			var e = this.requireInstance("encourage-payment/widget/paykey_safe_payment", {
				showType: t,
				errType: this._no,
				errTime: this._data.wrongtime
			});
			e.showDialog(this._sucCall, this._errCall, this._content)
		},
		_initMobile: function(t) {
			var e = this,
				i = this.requireInstance("encourage-payment/widget/mobile_safe_payment", {
					token: e._data.token,
					type: t
				});
			i.show(this._sucCall, this._errCall, this._content, this._mobileMsg)
		},
		_initFirstMobile: function(t) {
			var e = this,
				i = this.requireInstance("encourage-payment/widget/mobile_safe_payment", {
					token: e._data.token,
					type: t,
					firstFlag: !0
				});
			i.show(this._sucCall, this._sucCall, this._content)
		},
		_FROZEN_TPL: ['<div id="tdou_frozen_dialog" class="tdou_frozen_dialog clearfix">', "<p>\u60a8\u7684\u8d26\u53f7\u5904\u4e8e\u5f02\u5e38\u72b6\u6001\uff0c\u6682\u65f6\u4e0d\u80fd\u6d88\u8d39T\u8c46\uff0c\u7ed9\u60a8\u9020\u6210\u7684\u4e0d\u4fbf\u656c\u8bf7\u8c05\u89e3\u3002</p>", '<div class="tdou_frozen_btn_area clearfix">', '<a href="#" target="_blank" class="tdou_frozen_accept_btn tdou_frozen_btn" id="tdou_frozen_accept_btn">\u786e\u5b9a</a>', '<a href="#" class="tdou_frozen_cancel_btn tdou_frozen_btn" id="tdou_frozen_cancel_btn">\u53d6\u6d88</a>', "</div>", "</div>"].join(""),
		_initFrozen: function() {
			var t = this,
				e = new $.dialog({
					html: t._FROZEN_TPL,
					title: "T\u8c46\u51bb\u7ed3\u63d0\u793a"
				});
			$(e.element).find(".tdou_frozen_btn").click(function(t) {
				t.preventDefault(), e.close()
			}), e.onclose(function() {
				"function" == typeof t._errCall && t._errCall()
			})
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/qianbao_purchase_tdou",
	requires: ["encourage-payment/widget/qianbao_cashier_dialog", "encourage-payment/widget/base_user_data", "encourage-payment/widget/base_dialog_user_bar"],
	sub: {
		$root: null,
		tryOptions: null,
		payOptions: null,
		initial: function() {
			var a = this;
			a.cashierDialog = a.requireInstance("encourage-payment/widget/qianbao_cashier_dialog"), a.baseData = a.requireInstance("encourage-payment/widget/base_user_data"), a.baseDialogUserBar = this.requireInstance("encourage-payment/widget/base_dialog_user_bar"), a.cashierDialog.bind("event_tdou_qianbao_pay_again", a.payAgain, a)
		},
		payAgain: function() {
			var a = this;
			a._buy_icon_ajax && a._buy_icon_ajax.abort(), a._buy_icon_ajax = $.ajax({
				type: "get",
				url: "/tbmall/getPayUrl",
				data: a.tryOptions,
				cache: !1,
				dataType: "json"
			}).success(function(e) {
				if(e && 1990055 === e.error_code)
					if("undefined" == typeof passport || "undefined" == typeof passport.pop.init) {
						var i = "undefined" != typeof Env && Env.server_time ? Env.server_time : (new Date).getTime(),
							o = "https://passport";
						$.JsLoadManager.use([o + ".baidu.com/passApi/js/uni_login_wrapper.js?cdnversion=" + Math.floor(i / 6e4), o + ".baidu.com/passApi/js/wrapper.js?cdnversion=" + Math.floor(i / 6e4)], function() {
							window.realname = passport.pop.init({
								type: "accRealName",
								apiOpt: {
									product: "tb",
									staticPage: "//tieba.baidu.com/tb/static-common/html/pass/v3Jump.html"
								},
								tangram: !0,
								color: "green"
							}), window.realname.show()
						}, !0, "utf-8")
					} else window.realname.show();
				else {
					var n = e.data;
					a.payOptions.qianbao_params = n.return_url, a.payOptions.iconCount = n.iconCount, a.payOptions.iconId = n.iconId, a.showDialog(a.payOptions, a.tryOptions)
				}
			})
		},
		showDialog: function(a, e) {
			var i = this;
			i.tryOptions = e, i.payOptions = a, i.product = a.product || "tdou";
			var o = a.iconId || "suiji",
				n = a.iconCount || 1,
				t = {};
			i.getIconInfo(function(e) {
				var s = $.extend({}, e.data, {
					"package": e.package
				}, {
					custom_price: e.custom_price
				});
				for(var c in s) s[c].iconId == o && (t = {
					iconId: o,
					iconCount: n,
					iconImg: s[c].picUrl,
					memeberTdou: parseInt(1.05 * n * s[c].non_member_t),
					tdou: n * s[c].non_member_t,
					name: s[c].name,
					qianbao_params: a.qianbao_params
				}, t.pay_tdou = 2 == i.baseData.getMemberLevel() ? t.memeberTdou : t.tdou);
				i.showIcon(t)
			}, i)
		},
		showCustomDialog: function(a, e) {
			var i = this;
			i.tryOptions = e, i.payOptions = a, i.product = a.product || "tdou";
			var o = a.iconId || "suiji",
				n = a.iconCount || 1,
				t = a.iconIdFlag || "suiji",
				s = a.vip_extra_percent || 5,
				c = 1 + s / 100,
				r = {};
			i.getIconInfo(function(e) {
				for(var s in e.data) e.data[s].iconIdFlag = "normal_" + e.data[s].iconId;
				e.package && (e.package.iconIdFlag = "package_" + e.package.iconId), e.custom_price && (e.custom_price.iconIdFlag = "custom_" + e.custom_price.iconId);
				var p = $.extend({}, e.data, {
					"package": e.package
				}, {
					custom_price: e.custom_price
				});
				for(var d in p) p[d].iconIdFlag == t && (r = {
					iconId: o,
					iconCount: n,
					iconImg: p[d].picUrl,
					memeberTdou: 1 === e.setting.vip_extra_switch ? parseInt(n * c * p[d].non_member_t) : n * p[d].non_member_t,
					tdou: n * p[d].non_member_t,
					name: p[d].name,
					qianbao_params: a.qianbao_params
				}, r.pay_tdou = 2 == i.baseData.getMemberLevel() ? r.memeberTdou : r.tdou);
				i.showIcon($.extend({}, r, {
					vip_extra_percent: e.setting.vip_extra_percent,
					vip_extra_switch: e.setting.vip_extra_switch,
					is_mem: e.user_info.is_mem
				}))
			}, i)
		},
		showIcon: function(a) {
			var e = this,
				i = a.qianbao_params || "",
				o = $.extend(a, {
					baseDialogUserBarTpl: e.baseDialogUserBar.getUserBarTemplate(),
					isSuperMember: 2 == a.is_mem ? !0 : !1
				}),
				n = _.template('<div class="qianbao_cashier_purchase_tdou ">     <%=baseDialogUserBarTpl%>     <div class="qianbao_cashier_goods">         <div class="order_info clearfix" style="display: block;">             <label class="title order_label">\u5546\u54c1\u8ba2\u5355\uff1a</label>             <section class="order_desc clearfix">                 \u672c\u6b21\u83b7\u53d6<i class="icon-tbean"></i><span class="tdou_num"><%=pay_tdou%></span>\uff0c\u9700\u8981\u8d2d\u4e70\u4ee5\u4e0b\u5370\u8bb0\u6765\u5b8c\u6210             </section>         </div>         <div class="goods_list">             <label class="title goods_title">\u8d2d\u4e70\u5546\u54c1\uff1a</label>              <div class="icon_item">                 <div class="icon_desc">                     <%if(isSuperMember) {%>                         <p>\u8d85\u7ea7\u4f1a\u5458\u83b7\u8d60<i class="icon-tbean"></i><span class="orange-txt"><%=memeberTdou%></span></p>                     <%} else {%>                         <p>\u975e\u8d85\u7ea7\u4f1a\u5458\u83b7\u8d60<i class="icon-tbean"></i><span class="orange-txt"><%=tdou%></span></p>                     <%}%>                 </div>                 <div class="icon_img_box">                     <div class="icon_info" data-id="<%=iconId%>" data-price="1000" data-amount="110000">                         <img class="icon_img" src="<%=iconImg%>">                         <p class="tdou_text"><%=name%><span id="iconCount"><%=iconCount%></span>\u4e2a<span class="expire_date">\uff08\u6709\u6548\u671f\uff1a<span class="day"><%=iconCount%></span>\u5929\uff09</span></p>                     </div>                 </div>             </div>             <%if(!isSuperMember) {%>                 <p class="super-member-tips"><i class="icon-crown-super-vip"></i>\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458\u52a0\u9001<span class="orange-txt"><%=vip_extra_percent%>%</span>\uff0c\u83b7\u8d60<i class="icon-tbean"></i><span class="orange-txt"><%=memeberTdou%></span></p>             <%}%>         </div>     </div> </div> ')(o),
				t = {
					qianbao_params: i,
					product: e.product
				};
			e.cashierDialog.showDialog(t, n, function(a) {
				e.$root = a, e.bindEvents()
			})
		},
		bindEvents: function() {
			var a = this;
			a.$root.find(".j_header_close").on("click", function() {
				a.cashierDialog.closeDialog()
			}), a.$root.find(".qianbao_cashier_agreement a").on("click", function(a) {
				a.stopPropagation(), $.stats.track("\u4ed8\u6b3e\u5f39\u7a97\u5e95\u90e8", "\u83b7\u53d6T\u8c46\u4f1a\u5458\u670d\u52a1\u534f\u8bae\u70b9\u51fb", PageData.page ? PageData.page : "other", "click")
			})
		},
		getIconInfo: function(a, e) {
			var i = this,
				o = {
					ie: "utf-8"
				};
			o.tbs = PageData.tbs, i._get_icon_ajax && i._get_icon_ajax.abort(), i._get_icon_ajax = $.ajax({
				type: "get",
				url: "/tbmall/gettdouiconinfo",
				data: o,
				cache: !1,
				dataType: "json"
			}).success(function(i) {
				a.call(e, i)
			})
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/payment_dialog_title",
	requires: ["encourage-payment/widget/base_user_data", "user/widget/icons"],
	sub: {
		initial: function(e) {
			var s = this,
				t = {
					title: "",
					isNameShow: !1,
					isTdouShow: !1,
					isMemberShow: !1,
					onClose: $.noop
				};
			s.opts = $.extend(t, e), s.$container = e.$container, s.baseUserData = s.requireInstance("encourage-payment/widget/base_user_data"), s.userIcon = s.requireInstance("user/widget/icons"), s.rendTitle(), s.bindEvents()
		},
		getMemberIcon: function() {
			var e = this.baseUserData.getSimpleUserData(),
				s = this.userIcon.getPreIconHtml($.getPageData("mParr_props", {}, e), e, !0);
			return s
		},
		getIsMember: function() {
			var e = this.baseUserData.getMemberIcon().icon,
				s = "";
			return("ordinary_member_icon" == $.trim(e) || "super_member_icon" == $.trim(e) || e.indexOf("vip1-18") > 0 || e.indexOf("vip2-18") > 0) && (s = " member-red "), s
		},
		getUserName: function() {
			var e = this.baseUserData.getUserName() || "";
			return {
				name: e,
				formateName: e.length > 8 ? e.slice(0, 8) + "..." : e
			}
		},
		getUserTdou: function() {
			return this.baseUserData.getUserTdou() || 0
		},
		getTreasureNum: function() {
			return this.baseUserData.getUserTreasure() || 0
		},
		rendTitle: function() {
			var e = this,
				s = e.opts,
				t = _.template('<div class="payment-dialog-title">         <h4 class="payment-dialog-title-txt"><%=title%></h4>     <div class="payment-dialog-title-user">         <%if(isNameShow){%>         <div class="user-name">             <span class="payment-user-name-title">\u5e10\u53f7\uff1a</span><span title="<%=userName[\'name\']%>" class="orange-txt <%=memberClass%>"><%=memberIcon%><%=userName[\'formateName\']%></span>         </div>         <%}%>         <%if(isTdouShow){%>         <div class="user-tdou">             T\u8c46\u4f59\u989d\uff1a<i class="icon-tbean"></i><span class="orange-txt"><%=userTdouNum%></span>         </div>         <%}%>         <%if(isMemberShow){%>         <div class="user-member">         </div>         <%}%>         <%if(isTreasureShow){%>         <div class="user-treasure">             \u593a\u5b9d\u5e01\uff1a<span class="orange-txt"><%=userTreasureNum%></span>         </div>         <%}%>     </div>     <a href="javascript:;" class="payment-dialog-title-close j-payment-close"></a> </div>')({
					title: s.title || "",
					isNameShow: s.isNameShow,
					isTdouShow: s.isTdouShow,
					isMemberShow: s.isMemberShow,
					isTreasureShow: s.isTreasureShow,
					memberClass: e.getIsMember(),
					userName: e.getUserName(),
					userTdouNum: e.getUserTdou(),
					memberIcon: e.getMemberIcon(),
					userTreasureNum: e.getTreasureNum()
				});
			e.$container && e.$container.html(t)
		},
		bindEvents: function() {
			var e = this;
			e.$container.on("click", ".j-payment-close", function() {
				e.opts.onClose()
			})
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_get",
	requires: ["encourage-payment/widget/base_user_data", "encourage-payment/widget/payment_dialog_title", "encourage-payment/widget/show_dialog", "encourage-payment/widget/qianbao_purchase_tdou"],
	sub: {
		tdouOptionsHeight: 71,
		payChannel: 2,
		URL: {
			getTdouIconInfo: "/tbmall/gettdouiconinfo"
		},
		iconInfoList: [],
		orderNum: 1,
		iconId: "",
		iconIdFlag: "",
		iconData: null,
		vip_extra_percent: 5,
		amount_pay_limit: 0,
		high_limit: 999999,
		RATE: 1e3,
		initial: function(t) {
			var e = this;
			e.opts = t, e.initDialog(), e.baseUserData = e.requireInstance("encourage-payment/widget/base_user_data"), e.dataProxy = e.requireInstance("encourage-payment/widget/tdou_data", {
				scores: e.baseUserData.getUserTdou(),
				level: e.baseUserData.getMemberIcon().level
			}), e.getUserMember(), e.getTdouIconInfo(function(t) {
				e.vip_extra_percent = t.setting.vip_extra_percent, e.amount_pay_limit = t.setting.amount_pay_limit, e.renderContainer(t), e.bindEvents(), e.defaultSelect(t), e.clearLoading()
			})
		},
		defaultSelect: function(t) {
			var e = this;
			if(t.package) this.$dialog.find(".j-tdou-select").eq(0).click();
			else
				for(var a in e.iconInfoList) 1 === e.iconInfoList[a].is_default && this.$dialog.find(".j-tdou-select").eq(a).click();
			this.$tdouSelectView.show()
		},
		getUserMember: function() {
			var t = this.baseUserData.getMemberIcon();
			this.isSuperMember = 2 == t.level ? !0 : !1
		},
		getTdouIconInfo: function(t) {
			var e = this,
				a = {
					tbs: window.PageData.tbs,
					ie: "utf-8"
				};
			$.get(e.URL.getTdouIconInfo, a, function(a) {
				0 == a.no ? (a.normal_list = [a.data.tbxiaotietie, a.data.ff14, a.data.tbzhangyu, a.data.tbxiaoxiong], e.iconInfoList = a.normal_list, t && t(a)) : e.errorTips("\u7f51\u7edc\u9519\u8bef\uff0c\u8bf7\u7a0d\u5019\u91cd\u8bd5")
			})
		},
		initDialog: function() {
			var t = this;
			$(".tdou-get-dialog").length && $(".tdou-get-dialog").remove(), t.dialog = new $.dialog({
				html: _.template('<div class="tdou-get-dialog-container">     <section class="tdou-get-dialog-container-loading">         <img src="<%=url%>" class="loading-img">         <p>\u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u5019~</p>     </section> </div>')({
					url: "//tb2.bdstatic.com/tb/img/icon-loading_f0da091.gif"
				}),
				show: !1,
				holderClassName: "tdou-get-dialog",
				escable: !1,
				showTitle: !1,
				height: 440,
				width: 620
			}), t.$dialog = t.dialog.element, t.dialogCtrl = t.requireInstance("encourage-payment/widget/show_dialog", {
				container: t.dialog,
				type: "top-pop"
			}), t.dialogCtrl.show()
		},
		renderContainer: function(t) {
			var e = this;
			t.package && (e.dialog.height(500), e.$dialog.find(".tdou-get-dialog-container").css("height", "500"));
			var a = _.template('<section class="tdou-get-dialog-title"></section>  <section class="tdou-get-dialog-user">       <span class="main-title">\u5145\u503c\u8d26\u53f7:</span><%=user_info[\'user_name\']%> </section>  <div class="tdou-get-dialog-main"> <div class="main-title">\u9009\u62e9T\u8c46:</div>  <div class="tdou-options-active"> </div>  <%if(obj[\'package\']){%> <%var package_price = package[\'dubi\'] / 100;%> <section class="tdou-get-dialog-package j-tdou-select" data-name="package" id="<%=package[\'iconId\']%>" data-top="20" data-left="-2" data-icon={"num":"<%=package[\'non_member_t\']%>","price":"<%=package_price%>"}>   <img src="<%=package[\'package_pic\']%>" /> </section> <%}%>  <section class="tdou-get-dialog-selection">      <ul class="tdou-selection-list">         <%             var top = obj[\'package\'] ? 110 : 26;             var left = -135;             for(var i in normal_list) {             var item = normal_list[i];             left += 133;              var tbmall_price = item[\'dubi\'] / 100;         %>          <li class="tdou-options j-tdou-select" data-name="normal" id="<%=item[\'iconId\']%>" data-top="<%=top%>" data-left="<%=left%>" data-icon={"num":"<%=item[\'non_member_t\']%>","price":"<%=tbmall_price%>"}>             <div class="tdou-info">                 <i class="icon-tbean"></i><span class="tdou-num"><%= parseFloat(item[\'non_member_t\']).toLocaleString().split(\'.\')[0]%></span>             </div>             <div class="icon-div">                 <img class="icon-img" src="<%=item[\'picUrl\']%>" />                 <span class="icon-text"><%=item[\'name\']%><%=item[\'validity\']%>\u5929</span>             </div>             <div class="price-div">                 \xa5<span class="price"><%=tbmall_price%></span>             </div>         </li>         <%}%>     </ul> </section> <%var custom_price_i = custom_price[\'dubi\'] / 100;%> <section class="tdou-get-dialog-custom tdou-get-dialog-custom-tdou-select" data-name="custom" id="<%=custom_price[\'iconId\']%>" data-top="233" data-left="-2" data-icon={"num":"<%=custom_price[\'non_member_t\']%>","price":"<%=custom_price_i%>"}>     <div class="tdou-info">         <span class="tdou-num orange-txt"><i class="icon-tbean"></i><span class="custom-change-txt">0</span></span>         <div class="icon-div">             <img class="icon-img" src="<%=custom_price[\'picUrl\']%>" />             <span class="icon-text"><%=custom_price[\'name\']%><%=custom_price[\'validity\']%>\u5929</span>         </div>     </div>     <div class="price-div">         \xa5<input class="j-input-select input-select" type="text" pattern="d" placeholder="\u81ea\u5b9a\u4e49\u91d1\u989d"/>     </div> </section> <section class="tdou-get-dialog-money">  <span class="all-pay-money">\u9700\u652f\u4ed8:<b class="cash-num-view-txt change-txt">0</b>\u5143</span>  <%if (setting[\'vip_extra_switch\'] == 1 && setting[\'vip_extra_percent\'] != 0){%>  <span class="vip-extra-money">\u5171\u83b7\u8d60:<b class="tdou-num-view-txt change-txt"></b>T\u8c46</span>  <%}%>  <%if (setting[\'vip_extra_switch\'] == 1 && setting[\'vip_extra_percent\'] != 0){%>    <span class="vip-show"><ins class="icon-vip2-18"></ins>\u8d85\u7ea7\u4f1a\u5458\uff0c\u5c06\u52a0\u9001<%=setting[\'vip_extra_percent\']%>%</span>  <%}%> </section> <section class="tdou-get-dialog-btn">     <a href="javascript:;" class="payment-btn j-get-tdou">\u7acb\u5373\u652f\u4ed8</a>     <%if (setting[\'amount_pay_limit\'] > 0){%>       <%var limit = setting[\'amount_pay_limit\'] / 10000 %>       <a class="high-pay">\u5927\u4e8e<%=limit%>\u4e07\u4eba\u6c11\u5e01\u65f6\uff0c\u4f7f\u7528\u7f51\u94f6\u652f\u4ed8\u66f4\u5b89\u5168</a>     <%}%> </section> </div> <section class="tdou-get-dialog-container-bottom">     \u8bf7\u52a1\u5fc5\u5ba1\u9605\u5e76\u63a5\u53d7<a target="_blank" href="http://tieba.baidu.com/tb/tdouprecautions.html">\u300aT\u8c46\u8d2d\u4e70\u987b\u77e5\u300b</a>\u6240\u6709\u6761\u6b3e\uff0c \u5426\u5219\u60a8\u65e0\u6743\u4f7f\u7528\u672c\u670d\u52a1\u3002     <div class="protocol">         <a target="_blank" href="https://tieba.baidu.com/tb/tdou_highpay_pc.html">\u5145\u503c\u653b\u7565</a>|<a target="_blank" href="https://tieba.baidu.com/tb/tdou_highpay_show.html">\u9650\u989d\u67e5\u8be2</a>     </div> </section> ')(t);
			e.$dialog.find(".tdou-get-dialog-container").append(a), e.$dialogTitle = e.$dialog.find(".tdou-get-dialog-title"), e.$tdouSelectView = e.$dialog.find(".tdou-options-active"), e.$tdouCustom = e.$dialog.find(".tdou-get-dialog-custom"), e.$cashView = e.$dialog.find(".cash-num-view-txt"), e.$tdouNumView = e.$dialog.find(".tdou-num-view-txt"), e.$loadingView = e.$dialog.find(".tdou-get-dialog-container-loading"), e.$getTouBtn = e.$dialog.find(".j-get-tdou"), e.addTitle(), e.trackCtrl("view")
		},
		addTitle: function() {
			var t = this,
				e = {
					$container: t.$dialogTitle,
					title: "\u83b7\u53d6T\u8c46",
					isNameShow: !0,
					isTdouShow: !0,
					onClose: function() {
						t.dialogCtrl.close()
					}
				};
			t.requireInstance("encourage-payment/widget/payment_dialog_title", e)
		},
		changeTdouOptions: function(t) {
			var e = t.tbattr("id"),
				a = Number(t.data("top")),
				i = Number(t.data("left")),
				o = this.$tdouSelectView,
				n = $(t).width(),
				s = t.data("name") && "custom" == t.data("name") ? $(t).height() : $(t).height() - 2;
			this.iconData = t.data("icon"), this.iconId = e, this.iconIdFlag = t.data("name") + "_" + e, o.show(), this.$tdouCustom.removeClass("tdou-get-dialog-custom-tdou-select"), this.$dialog.find(".price-div").removeClass("orange-txt"), t.find(".price-div").addClass("orange-txt"), "custom" != t.data("name") || t.hasClass("tdou-get-dialog-custom-tdou-select") || (o.hide(), t.addClass("tdou-get-dialog-custom-tdou-select")), o.animate({
				left: i,
				top: a,
				width: n,
				height: s
			}, "fast", "swing", function() {}), this.orderViewUpdate()
		},
		customViewUpdate: function(t) {
			var e = 0 == t ? "" : t,
				a = /(\d+?)(?=(?:\d{3})+$)/g;
			this.$dialog.find(".custom-change-txt").html((1e3 * t + "").replace(a, "$1,")), this.$dialog.find(".j-input-select").val(e)
		},
		orderViewUpdate: function() {
			var t = this;
			if(t.orderNum && t.iconId) {
				var e = t.iconData,
					a = t.orderNum,
					i = Number(e.price) * a,
					o = Number(e.num) * a;
				t.isSuperMember && (o += o * t.vip_extra_percent / 100), t.$cashView.html(i), t.$tdouNumView.html(o)
			} else t.$cashView.html(0), t.$tdouNumView.html(0)
		},
		getTdou: function() {
			var t = this,
				e = $.tb.location.getHref();
			t.setLoading();
			var a = t.opts && t.opts.consumption_path || 0;
			t.dataProxy.payIcon(t.iconId, t.orderNum, t.buyIcon, t, e, a, t.payChannel)
		},
		buyIcon: function(t) {
			var e = this;
			if(t && 0 == t.no) {
				e.cashier = e.requireInstance("encourage-payment/widget/qianbao_purchase_tdou");
				var a = t.data,
					i = e.$tdouNumView.html(),
					o = e.opts && e.opts.consumption_path || 0,
					n = $.extend({
						product: "tdou",
						consumption_path: o,
						goods_cost_tdou: i,
						pay_type: 6,
						pay_channel: e.payChannel,
						iconIdFlag: e.iconIdFlag,
						vip_extra_percent: e.vip_extra_percent
					}, {
						qianbao_params: a.return_url,
						iconCount: a.iconCount,
						iconId: a.iconId
					}),
					s = {
						ie: "utf-8",
						tbs: window.PageData.tbs,
						terminal: "pc",
						pay_type: 6,
						iconId: a.iconId,
						iconIdFlag: e.iconIdFlag,
						vip_extra_percent: e.vip_extra_percent,
						pageUrl: a.return_url || "",
						margin: i,
						goodsCost: i,
						fr: o || 0,
						channel: e.payChannel
					};
				e.cashier.showCustomDialog(n, s), setTimeout(function() {
					e.clearLoading()
				}, 1e3)
			} else if(t && 11e4 === t.no) e.requireInstance("tbui/widget/login_dialog");
			else if(t && 1990055 === t.error_code)
				if("undefined" == typeof passport || "undefined" == typeof passport.pop.init) {
					var c = "undefined" != typeof Env && Env.server_time ? Env.server_time : (new Date).getTime(),
						d = "https://passport";
					$.JsLoadManager.use([d + ".baidu.com/passApi/js/uni_login_wrapper.js?cdnversion=" + Math.floor(c / 6e4), d + ".baidu.com/passApi/js/wrapper.js?cdnversion=" + Math.floor(c / 6e4)], function() {
						window.realname = passport.pop.init({
							type: "accRealName",
							apiOpt: {
								product: "tb",
								staticPage: "//tieba.baidu.com/tb/static-common/html/pass/v3Jump.html"
							},
							tangram: !0,
							color: "green"
						}), window.realname.show()
					}, !0, "utf-8")
				} else window.realname.show();
			else setTimeout(function() {
				e.clearLoading()
			}, 1e3)
		},
		clearLoading: function() {
			var t = this;
			t.$loadingView.hide(), t.$getTouBtn.removeClass("loading")
		},
		setLoading: function() {
			this.$loadingView.show(), this.$getTouBtn.addClass("loading")
		},
		changePaymentBtnStatus: function(t) {
			"" === t ? this.$getTouBtn.addClass("payment-disable").removeClass("j-get-tdou") : this.$getTouBtn.removeClass("payment-disable").addClass("j-get-tdou")
		},
		bindEvents: function() {
			var t = this;
			t.$dialog.on("click", ".j-tdou-select", function(e) {
				var a = $(e.currentTarget);
				t.orderNum = 1, t.changeTdouOptions(a), t.customViewUpdate(0), t.trackCtrl("choose"), t.$getTouBtn.removeClass("payment-disable").addClass("j-get-tdou")
			}).on("click", ".j-get-tdou", function(e) {
				var a = $(e.target);
				a.hasClass("loading") || (t.getTdou(), t.dialogCtrl.close(), t.trackCtrl("pay"))
			}).on("click", ".j-get-member", function() {
				$.stats.track("T\u8c46\u94b1\u5305", "\u4f1a\u5458\u5065\u5eb7\u7edf\u8ba1", "", "click", {
					obj_name: "\u83b7\u53d6T\u8c46\u70b9\u51fb\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458"
				})
			}).on("focus", ".j-input-select", function() {
				var e = $(this),
					a = parseInt(e.val(), 10);
				a || (a = ""), t.orderNum = a, t.changePaymentBtnStatus(a), t.changeTdouOptions(e.parents(".tdou-get-dialog-custom"))
			}).on("input", ".j-input-select", function() {
				var e = $(this),
					a = parseInt(e.val(), 10);
				if(a)
					if(a > t.high_limit) {
						var i = a + "";
						a = parseInt(i.slice(0, i.length - 1), 10)
					} else a = a;
				else a = "";
				e.val((a + "").replace(/[^\d]*/gi, "")), t.changePaymentBtnStatus(a), t.orderNum = a, t.orderViewUpdate(), t.customViewUpdate(a), Number(a) > Number(t.amount_pay_limit) && t.amount_pay_limit > 0 ? t.$dialog.find(".high-pay").show() : t.$dialog.find(".high-pay").hide()
			})
		},
		trackCtrl: function(t) {
			var e = "custom";
			switch(t) {
				case "view":
					$.stats.track("show-" + e, "TdouCashier", "", "view", {
						tdouViewType: e
					});
					break;
				case "choose":
					$.stats.track("choose-" + e, "TdouCashier", "", "click", {
						tdouViewType: e
					});
					break;
				case "pay":
					$.stats.track("buy-" + e, "TdouCashier", "", "click", {
						tdouViewType: e
					})
			}
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tbean_safe_ajax",
	requires: ["encourage-payment/widget/tbean_safe"],
	sub: {
		initial: function(e) {
			this.options = e || {}
		},
		ajax: function(e) {
			var a = this,
				t = e.success || function() {},
				n = e.data || {},
				s = function(s) {
					var i = a.requireInstance("encourage-payment/widget/tbean_safe", {
						json: s,
						sucCallback: function(t) {
							var s = $.extend({}, n, t),
								i = $.extend({}, e);
							i.data = s, a.ajax(i)
						},
						tbeanOptions: a.options
					});
					i.needCheck() || t(s)
				};
			return e.success = s, e.type = e.type || "post", e.dataType = e.dataType || "json", $.ajax(e)
		},
		post: function(e, a, t) {
			var n = {
				url: e,
				data: a,
				success: t
			};
			return this.ajax(n)
		}
	}
});
! function() {
	userScore = null, userLevel = null, _.Module.define({
		path: "encourage-payment/widget/tdou_data",
		requires: ["encourage-payment/widget/tbean_safe_ajax"],
		sub: {
			tipData: {
				tbxiaoniu: "\u767d\u5929\u5973\u5c4c\u4e1d\uff0c\u665a\u4e0a\u591c\u5e97\u5973\u738b",
				tbzhangyu: "\u7231\u597d\u591a\u591a\uff0c\u4e3a\u5174\u8da3\u800c\u751f",
				tbxiaoxiong: "\u718a\u6f6e\u718a\u6d77\u4e2d\u6709\u4f60\u6709\u6211",
				tbxiaotietie: "\u8d34\u5427\u5c0f\u8d34\u8d34",
				ff14: "\u6700\u7ec8\u5e7b\u60f314\u4e13\u5c5e\u5370\u8bb0"
			},
			route: {
				getIconInfo: "/tbmall/gettdouiconinfo",
				buyIcon: "/tbmall/getPayUrl",
				getTdou: "/tbmall/getUserTd",
				getPayInfo: "/tbmall/open/getBuyForm",
				payGoods: "/tbmall/submit/open/pay",
				get3rdOrder: "/tbmall/open/getOrder",
				consumerInfo: "/tbmall/user/getConsumerInfo"
			},
			_item_raw_cache: null,
			_item_raw_cache_pay_info: null,
			_item_cache_last_total_tdou: 0,
			_parrScores: null,
			_parrProps: null,
			initial: function(e) {
				this.iconConfig = PageUnit.load("icons_cfg"), e && (e = $.extend({}, e), userScore = e.scores || userScore, userLevel = e.level || userLevel)
			},
			setParrScores: function(e) {
				this._parrScores = e, e && (userScore = e)
			},
			setParrProps: function(e) {
				this._parrProps = e, e && e.level && (userLevel = e.level)
			},
			getUserName: function() {
				return PageData.user.name || PageData.user.name_url
			},
			getUserTdou: function() {
				var e = (PageData.user, this._parrScores || userScore);
				return e ? e.scores_money + e.scores_other : 0
			},
			getCacheUserTotalTdou: function() {
				return this._item_cache_last_total_tdou
			},
			getShowName: function() {
				return PageData.user.name_show || PageData.user.user_name
			},
			isMemeber: function() {
				var e = this._getMaxLevel(userLevel);
				return !!e
			},
			getMemberLevel: function() {
				var e = this._getMaxLevel(userLevel);
				return e
			},
			getMemberIcon: function() {
				var e = this._getMaxLevelExpire(userLevel),
					a = "member_icon",
					t = "member_icon ";
				switch(e) {
					case 1:
						a = t + " low_member_icon";
						break;
					case -1:
						a = t + " low_member_icon_expire";
						break;
					case -2:
						a = t + " member_icon_expire";
						break;
					case 2:
						a = t;
						break;
					default:
						a = ""
				}
				return a
			},
			isLogin: function() {
				return PageData.user.is_login
			},
			needUpdateTdou: function() {
				var e = userScores;
				return !(props && e)
			},
			_getMaxLevel: function(e) {
				var a = 0,
					t = (new Date).getTime(),
					r = e || userLevel;
				return r && 1e3 * r.end_time > t && parseInt(r.props_id, 10) > a && (a = parseInt(r.props_id, 10)), a
			},
			_getMaxLevelExpire: function(e) {
				var a = 0,
					t = (new Date).getTime(),
					r = e || userLevel;
				return r && parseInt(r.props_id, 10) > a && (a = parseInt(r.props_id, 10), 1e3 * r.end_time <= t && (a = 0 - a)), a
			},
			getAdvanceMember: function() {
				var e = "//tieba.baidu.com/tbmall/getPayUrl?terminal=pc&pay_type=1&is_jump=1";
				return e
			},
			getIconInfo: function(e, a) {
				var t = this,
					r = {
						ie: "utf-8"
					};
				r.tbs = PageData.tbs, t._get_icon_ajax && t._get_icon_ajax.abort(), t._get_icon_ajax = $.ajax({
					type: "get",
					url: t.route.getIconInfo,
					data: r,
					cache: !1,
					dataType: "json"
				}).success(function(r) {
					if(r && 0 === r.no) {
						var o = r.data;
						t._item_raw_cache = r.data, r.data = t.dapterIconListData(o)
					}
					e.call(a, r)
				})
			},
			dapterIconListData: function(e) {
				var a = {};
				if(e)
					for(var t in e)
						if(e.hasOwnProperty(t)) {
							var r = {
								icon_id: e[t].iconId,
								icon_name: e[t].name || "\u968f\u673a\u5370\u8bb0",
								icon_picurl: e[t].picUrl,
								member_price: "",
								non_member_price: e[t].non_member_t,
								price_diff: "",
								tbmall_price: e[t].dubi / 100
							};
							r.member_price = this.calcIconMemberPrice(e[t].dubi, e[t].non_member_t, e[t].discount, 1), a[t] = r
						}
				return a
			},
			calcIconMemberPrice: function(e, a, t, r) {
				var o = 0,
					n = e * r,
					_ = 1;
				for(var i in t) {
					if(!(n >= i)) return o = 1 === _ ? a : a * r * t[_] / 100;
					_ = i
				}
				return o = a * r * t[_] / 100
			},
			getPriceInfo: function(e, a) {
				var t = this,
					r = null,
					o = this.getCache(a);
				return o && (r = {
					icon_id: o.iconId,
					member_price: "",
					non_member_price: t._convertNum(o.non_member_t * e),
					tbmall_price: t._convertNum(o.dubi * e / 100)
				}, r.member_price = t.calcIconMemberPrice(o.dubi, o.non_member_t, o.discount, e), r.member_price = t._convertNum(r.member_price)), r
			},
			_convertNum: function(e) {
				return e > 99999999 ? Math.floor(e / 1e8) + "\u4ebf" : e > 9999999 ? Math.floor(e / 1e7) + "\u5343\u4e07" : e > 999999 ? Math.floor(e / 1e6) + "\u767e\u4e07" : e > 99999 ? Math.floor(e / 1e4) + "\u4e07" : e
			},
			payIcon: function(e, a, t, r, o, n, _) {
				var i = this,
					c = {
						ie: "utf-8",
						tbs: PageData.tbs,
						terminal: "pc",
						pay_type: 6,
						iconId: e,
						iconCount: a,
						fr: n || 0,
						pageUrl: o || "",
						channel: _ || 0
					};
				i._payIcon(c, t, r)
			},
			payIconWithMargin: function(e, a, t, r, o, n, _, i, c, s, u) {
				var d = this;
				i = i || 6, c = c || PageData.tbs;
				var p = {
					ie: "utf-8",
					tbs: c,
					terminal: "pc",
					pay_type: i,
					iconId: e,
					pageUrl: o || "",
					margin: a,
					goodsCost: _,
					fr: n || 0,
					third_order_id: s,
					channel: u
				};
				d._payIcon(p, t, r)
			},
			_payIcon: function(e, a, t) {
				var r = this;
				r._buy_icon_ajax && r._buy_icon_ajax.abort(), r._buy_icon_ajax = $.ajax({
					type: "get",
					url: r.route.buyIcon,
					data: e,
					cache: !1,
					dataType: "json"
				}).success(function(e) {
					a.call(t, e)
				})
			},
			getTdou: function(e, a, t) {
				var r = this;
				r._get_tdou_ajax && r._get_tdou_ajax.abort(), r._get_tdou_ajax = $.ajax({
					type: "get",
					url: r.route.getTdou + "?" + new Date,
					data: {},
					cache: !1,
					dataType: "json"
				}).success(function(r) {
					e.call(a, r, t)
				})
			},
			getThirdOrderInfo: function(e, a, t) {
				var r = this,
					o = {
						order_id: t
					};
				r._get_3rd_order_ajax && r._get_3rd_order_ajax.abort(), r._get_3rd_order_ajax = $.ajax({
					type: "get",
					url: r.route.get3rdOrder,
					data: o,
					cache: !1,
					dataType: "json"
				}).success(function(t) {
					if(0 == t.no) {
						r._item_cache_last_total_tdou = r.getUserTdou();
						var o = t.data.user_info;
						r.setParrScores(o.Parr_scores), r.setParrProps(o.Parr_props)
					}
					e.call(a, t)
				})
			},
			getCache: function(e) {
				return e ? this._item_raw_cache[e] : {}
			},
			clearCache: function() {
				this._item_raw_cache = null
			},
			getPayInfoCache: function() {
				return this._item_raw_cache_pay_info
			},
			getTipData: function(e) {
				var a = this.getCache(e),
					t = {};
				return t.icon_name = a.name, t.icon_expired = 1, t.icon_desc = this.iconConfig[a.name + "_1"] || this.tipData[e], t
			},
			getPayInfo: function(e, a, t) {
				var r = this,
					o = {
						open_id: e.open_id,
						order_id: e.order_id,
						goods_name: e.goods_name,
						goods_image: e.goods_image,
						goods_price: e.goods_price,
						goods_amount: e.goods_amount,
						goods_unit: e.goods_unit,
						goods_duration: e.goods_duration,
						free_vip_level: e.free_vip_level,
						timestamp: e.timestamp,
						scene_id: e.scene_id,
						pay_type: e.pay_type,
						from: e.from,
						tdou_num: e.tdou_num
					};
				r._get_pay_info_ajax && r._get_pay_info_ajax.abort(), r._get_pay_info_ajax = $.ajax({
					type: "post",
					url: r.route.getPayInfo,
					data: o,
					cache: !1,
					dataType: "json"
				}).success(function(e) {
					if(r._item_raw_cache_pay_info = e.data, 0 == e.no) {
						r._item_cache_last_total_tdou = r.getUserTdou();
						var o = e.data.user_info;
						r.setParrScores(o.Parr_scores), r.setParrProps(o.Parr_props)
					}
					a.call(t, e)
				})
			},
			payGoods: function(e, a, t) {
				var r = this,
					o = r._item_raw_cache_pay_info.order_info,
					n = r._item_raw_cache_pay_info.tbs;
				if(o) {
					var _ = {
						order_id: o.order_id,
						open_id: o.open_id,
						scene_id: o.scene_id,
						pay_type: o.pay_type,
						tbs: n
					};
					r._get_pay_goods_ajax && r._get_pay_goods_ajax.abort();
					var i = r.requireInstance("encourage-payment/widget/tbean_safe_ajax");
					i.ajax({
						type: "post",
						url: r.route.payGoods,
						data: _,
						cache: !1,
						dataType: "json",
						success: function(r) {
							e.call(a, r, t)
						}
					})
				}
			},
			getConsumerInfo: function(e, a, t) {
				var r = this;
				e = e || {
					scene_id: ""
				}, r._getConsumerInfo && r._getConsumerInfo.abort(), r._getConsumerInfo = $.ajax({
					type: "GET",
					url: r.route.consumerInfo,
					data: e,
					cache: !1,
					dataType: "json"
				}).success(function(e) {
					0 == e.no && a.call(t, e.data), r._getConsumerInfo = null
				})
			}
		}
	})
}();
_.Module.define({
	path: "encourage-payment/widget/umoney",
	sub: {
		$root: null,
		actionType: {
			closeCashier: "CLOSE_CASHIER",
			openCashier: "OPEN_CASHIER",
			closePayment: "CLOSE_PAYMENT",
			openPayment: "OPEN_PAYMENT"
		},
		initial: function() {},
		getMainUIDom: function(e) {
			if(e) {
				var t = e.isMember;
				if(!t) {
					var n = e.isGoodsFreeForMember,
						a = e.isRecharge,
						o = e.isConsumption,
						i = this,
						r = "",
						s = 0;
					switch(e.actionType) {
						case i.actionType.closeCashier:
							s = i.getCountOneDay(i.actionType.closeCashier), n && 1 == s && (r = i.geTtplWhenClosePay());
							break;
						case i.actionType.openCashier:
							s = i.getCountOneDay(i.actionType.openCashier), n || (a || 1 != s) && (o || 2 != s) || (r = i.geTtplWhenOpenCashier());
							break;
						case i.actionType.closePayment:
							s = i.getCountOneDay(i.actionType.closePayment), n && 2 == s && (r = i.geTtplWhenClosePay());
							break;
						case i.actionType.openPayment:
					}
					return r && (i.$root = $(r), i.bindEvents(), i.track("show")), i.$root
				}
			}
		},
		bindEvents: function() {
			var e = this;
			e.$root.on("click", ".try-use-btn", function() {
				e.track("try-btn"), e.trigger("closeDialogEvent")
			}).on("click", ".dont-use-btn", function() {
				e.track("dont-btn"), e.trigger("closeDialogEvent")
			})
		},
		geTtplWhenOpenCashier: function() {
			var e = '<div class="umoney-wrap "><div class="text">\u6b64\u5546\u54c1\u53ef\u901a\u8fc7\u767e\u5ea6\u6709\u94b1\u63d0\u4f9b\u7684<div>\u2014\u2014\u5148\u4f7f\u7528\u540e\u4ed8\u6b3e\uff01\u670d\u52a1\u83b7\u53d6</div></div><div class="btn-wrap open-cashier-btn-wrap"><button class="btn-default  btn-larger dont-use-btn">\u4e0d\u9700\u8981\u6b64\u670d\u52a1</button><a target="_blank" href="/f?ie=utf-8&kw=\u767e\u5ea6\u6709\u94b1\u6d88\u8d39\u91d1\u878d" class="btn-attention  btn-larger try-use-btn">\u4f53\u9a8c\u5c1d\u8bd5</a></div></div>';
			return e
		},
		geTtplWhenClosePay: function() {
			var e = '<div class="umoney-wrap"><div class="text">\u6b64\u5546\u54c1\u53ef\u901a\u8fc7\u767e\u5ea6\u6709\u94b1\u63d0\u4f9b\u7684<div>\u2014\u2014\u5148\u4f7f\u7528\u540e\u4ed8\u6b3e\uff01\u670d\u52a1\u83b7\u53d6</div></div><div class="btn-wrap  close-payment-btn-wrap"><a  target="_blank" href="/f?ie=utf-8&kw=\u767e\u5ea6\u6709\u94b1\u6d88\u8d39\u91d1\u878d" class="btn-attention  btn-larger try-use-btn">\u4f53\u9a8c\u5c1d\u8bd5</a></div></div>';
			return e
		},
		getCountOneDay: function(e) {
			if(e) {
				var t = "TB-UMONEY-COUNTER-" + e,
					n = $.tb.Storage.get(t),
					a = new Date,
					o = new Date(a.getFullYear(), a.getMonth(), a.getDate(), 23, 59, 59);
				return n ? (n = parseInt(n), n++) : n = 1, $.tb.Storage.set(t, n, o), n
			}
		},
		track: function(e) {
			$.stats.track(e, "umoney-payment", PageData.product, "click")
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_template",
	sub: {
		get_icon_main_tpl: "",
		get_icon_item_tpl: "",
		initial: function() {},
		getMainFrame: function() {
			var _ = this;
			if(!_.get_icon_main_tpl) {
				var a = ['<input id="tdou_remain_num" type="hidden" value="#{tdou_amount}" />', '<div class=" tdou_base tdou_buy_box j_tdou_base">', '    <div class="tdou_header">', '        <div><span class="header_icon"></span>\u83b7\u53d6T\u8c46</div>', '        <a class="header_close j_header_close"></a>', "    </div>", '    <div class="list_body clearfix">', '        <ul class="j_tdou_base_list">', "#{list}", "        </ul>", "    </div>", '   <div class="tdou_counter_wrap">', '<span class="tdou_counter_num_text">\u8d2d\u4e70\u6570\u91cf\uff1a</span><div class="tdou_counter_replace j_tdou_counter_replace"></div>', '<span class="tdou_counter_info">\u9700\u652f\u4ed8\uff1a<ins class="j_goods_tmall_price_num"></ins> \u5143</span>', '<span class="tdou_counter_info">\u83b7\u8d60\uff1a<ins class="j_goods_member_num"></ins> T\u8c46</span>', "   </div>", '    <div class="tdou_footer">', '        <a class="btn tdou_buy_btn_big j_tdou_buy_btn_big">\u7acb\u5373\u8d2d\u4e70</a>', "    </div>", "</div>", '<div class="tdou_umoney j_tdou_umoney"></div>'].join("");
				_.get_icon_main_tpl = a
			}
			return _.get_icon_main_tpl
		},
		getIconItem: function() {
			var _ = this;
			if(!_.get_icon_item_tpl) {
				var a = ['<li id="#{icon_id}" class="j_tdou_get_item tdou_list_item_#{idx}">', '<div class="goods_wrap_border"></div>', '<div class="good_wrap_new clearfix">', '<div class="good_price_new">', '<p class="good_price_rmb">\u4ef7\u683c\uff1a#{tbmall_price}\u5143</p>', '<p class="good_price_detail">', '<span class="good_price_extra">\u8d60\u9001\uff1a<ins>#{non_member_price}</ins>T\u8c46</span>', '<span class="good_price_joinvip"><a class="member_icon" href="/tbmall/tshow" target="_blank"></a><a href="/tbmall/tshow" target="_blank">\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458</a>\u52a0\u9001<ins>#{per_price}%</ins> <ins>#{price_diff}</ins>T\u8c46</span>', "</p>", "</div>", '<div class="good_info_new">', '<img src="#{icon_picurl}" class="j_icon_img" width="26" height="26"/>', "<p>#{icon_name}<br/><span>\u6709\u6548\u671f\uff1a</span>1\u5929</p>", "</div>", '<div class="tdou_buy_selected"></div>', "</div>", "</li>"].join("");
				_.get_icon_item_tpl = a
			}
			return _.get_icon_item_tpl
		},
		getLoadingTpl: function() {
			var _ = this;
			if(!_.get_icon_loading_tpl) {
				var a = ['<div class="tdou_get_icon_loading j_tdou_get_icon_loading">', '    <div class="tdou_loading_img_wrap">', "    </div>", '    <div class="tdou_loading_text">', "        \u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u7b49", "    </div>", "</div>"].join("");
				_.get_icon_loading_tpl = a
			}
			return _.get_icon_loading_tpl
		},
		getTipInfoMainFrame: function() {
			var _ = this;
			if(!_.get_icon_tip_main_tpl) {
				var a = ['<div class="tdou_get_icon_tip j_tdou_get_icon_tip">', '    <div class="tdou_tip_img_wrap #{tip_img}">', "    </div>", '    <div class="tdou_tip_text">', "    #{tdou_tip_text}", "    </div>", "</div>"].join("");
				_.get_icon_tip_main_tpl = a
			}
			return _.get_icon_tip_main_tpl
		},
		getTipInfoCheckPayInfoAndTdouInfo: function() {
			var _ = this;
			if(!_.get_tdou_info_tpl) {
				var a = ['<div class="tdou_get_icon_check j_tdou_get_icon_check">', '  <a class="header_close j_header_close"></a>', '    <div class="tdou_tip_img_wrap"></div>', '    <div class="tdou_tip_text">', '      <div class = "tdou_check_title">', "            \u8bf7\u5728\u65b0\u6253\u5f00\u7684\u9875\u9762\u5b8c\u6210\u83b7\u53d6\u64cd\u4f5c", "        </div>", '        <div class = "tdou_check_op">', '           <a class="btn check_btn j_check_btn" href="javascript:void(0)">\u67e5\u770b\u7ed3\u679c</a> ', '		   <a class="btn_redo_check j_btn_redo_check"  href="javascript:void(0)">\u83b7\u53d6\u5370\u8bb0\u5931\u8d25\uff0c\u91cd\u65b0\u83b7\u53d6</a>', "        </div>", "    </div>", "</div>"].join("");
				_.get_tdou_info_tpl = a
			}
			return _.get_tdou_info_tpl
		},
		getMaskLayer: function() {
			return '<div class="tdou_mask j_tdou_mask"></div>'
		},
		getIconInfoTip: function() {
			var _ = this;
			return _.get_icon_info_tip_tpl || (_.get_icon_info_tip_tpl = ['<div class="tdou_get_icon_info_tip j_tdou_get_icon_info_tip">', '    <div class="info_tip_wrap">', '        <p class="icon_name j_icon_name">\u3010#{icon_name}\u3011</p>', '        <p class="icon_expired ">\u6709\u6548\u671f <span class="days j_icon_expired">#{icon_expired}</span> \u5929/\u4e2a</p>', '        <p class="icon_desc j_icon_desc">#{icon_desc}</p>', "    </div>", '    <span class="tip_arrow"></span>', "</div>"].join("")), _.get_icon_info_tip_tpl
		},
		getTdouPayInfoMain: function() {
			var _ = this;
			return _.tdou_pay_info_main || (_.tdou_pay_info_main = ['<div class="tdou_base tdou_pay_info_box j_baidu_tb_tdou_pay_info_box">', '    <div class="tdou_pay_info_header clearfix">', '        <div class="header_title"><span class="tdou_pay_header_icon"></span>T\u8c46\u5151\u6362</div>', '        <a class="tdou_pay_header_close j_tdou_pay_header_close"></a>', "    </div>", '    <div class="tdou_pay_info_body clearfix">', '        <div class="sale_info">', "            #{sale_info}", "        </div>", '        <div class="payment_info">', "            #{payment_info}", "        </div>", "    </div>", "</div>"].join("")), _.tdou_pay_info_main
		},
		getTdouPayInfoGoodsInfoBase: function() {
			var _ = this;
			return _.tdou_pay_info_goods_base || (_.tdou_pay_info_goods_base = ['<div class="goods_wrap">', '    <div class="goods_title j_goods_title" title="#{goods_full_name}">\u3010#{goods_name}\u3011</div>', '    <div class="goods_img">', '        <div class="goods_img_wrap">', '            <img class="j_goods_img" src="#{goods_img}"/>', "        </div>", "    </div>", '    <div class="goods_info">', '        <div class="goods_info_amount">', '            <span class="goods_info_lable">\u6570\u91cf\uff1a</span>', '            <span class="goods_info_val j_goods_info_amount_val">#{goods_info_amount_val}</span>', '            <span class="goods_info_unit j_goods_info_amount_unit">#{goods_info_amount_unit}</span>', "        </div>", '        <div class="goods_info_duration">', '            <span class="goods_info_lable">\u65f6\u957f\uff1a</span>', '            <span class="goods_info_val j_goods_info_duration_val">#{goods_info_duration_val}</span>', '            <span class="goods_info_unit j_goods_info_duration_unit">#{goods_info_duration_unit}</span>', "        </div>", "    </div>", '    <div class="goods_sale">', '        <div class="good_price">', '          <span class="good_price_label">\u603b\u4ef7\uff1a', '          <span class="tdou_icon"  title="T\u8c46"></span>', '          <span class="good_price_val j_good_price_val">#{good_price_val}</span></span>', "        </div>", "    </div>", "</div>"].join("")), _.tdou_pay_info_goods_base
		},
		getTdouPayInfoPaymentInfoBase: function() {
			var _ = this;
			return _.tdou_pay_info_payment_base || (_.tdou_pay_info_payment_base = ['<div class="payment_desc j_payment_desc"><div class="payment_desc_content_float"></div>', '<div class="payment_desc_content">#{payment_desc}</div>', "</div>", '<div class="tdou_pay_btn_wrap j_tdou_pay_btn_wrap">', "#{btn}", "</div>"].join("")), _.tdou_pay_info_payment_base
		},
		getTdouPayInfoPaymentInfoPlaceHolder: function() {
			var _ = '<div class="payment_desc j_payment_place_holder"></div>';
			return _
		},
		getTdouPayInfoPaymentInfoTip: function() {
			return '<div class="tdou_pay_info_tip">#{checkbox}<span class="member_icon"></span><a href="javascript:void(0);" class="j_tdou_open_super_member_link" target="_blank">\u5f00\u901a\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458</a>\u4e70\u5370\u8bb0\u83b7\u8d60\u6700\u9ad85%T\u8c46</div>'
		},
		getTdouPayInfoOpenMemberFreeGoodsTip: function() {
			return '<div class="tdou_pay_info_tip"><span class="member_icon"></span><a href="javascript:void(0);" class="j_tdou_open_super_member_link"  target="_blank">\u5f00\u901a\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458</a>\u53ef\u514d\u8d39\u83b7\u53d6\u8be5\u5546\u54c1</div>'
		},
		getTdouPayInfoPaymentInfoByMember: function() {
			return '<div class="tdou_pay_info_tip"><span class="member_icon"></span>\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458<a href="javascript:void(0)" class="j_tdou_buy_icon">\u8d2d\u4e70\u5370\u8bb0</a>\u83b7\u53d6\u6700\u9ad85%T\u8c46</div>'
		},
		getTdouPayInfoPaymentInfoPayConfirm: function() {
			return '<div class="tdou_pay_info_buy_comfirm"><span class="checkbox_buy_comfirm"><input type="checkbox" class="j_tdou_buy_confirm"/></span>\u4eca\u65e5<span class="j_buy_comfirm_days">30</span>\u6b21\u5185\u4e0d\u518d\u63d0\u793a\u786e\u8ba4\u8d2d\u4e70</div>'
		},
		getTdouPayInfoPaymentInfoBtn_pay: function() {
			return '<a class="btn tdou_pay_btn j_tb_tdou_pay_btn">#{tb_tdou_pay_btn}</a>'
		},
		getTdouPayInfoPaymentInfoBtn_get: function() {
			return '<a class="btn tdou_pay_btn j_tb_tdou_get_tdou_btn">\u83b7\u53d6T\u8c46</a>'
		},
		getTdouPayInfoPaymentInfo_tdouEnough: function() {
			return '<div class="payment_desc_text">\u60a8\u5728<span class="j_tdou_pay_from">#{tdou_pay_from}</span>\u83b7\u53d6<span class="j_tdou_pay_goods_name" title="#{goods_full_name}">\u3010#{tdou_pay_goods_name}\u3011</span></div><div class="payment_desc_text">\u9700\u8981\u6d88\u8017<span class="tdou_icon"  title="T\u8c46"></span><span class="good_price_val j_tdou_pay_need_tdou">#{tdou_pay_need_tdou}</span>T\u8c46\u5151\u6362\u8be5\u5546\u54c1</div>'
		},
		getTdouPayInfoPaymentInfo_tdouNoEnough: function() {
			return '<div class="payment_desc_text">\u60a8\u5728<span class="j_tdou_pay_from">#{tdou_pay_from}</span>\u83b7\u53d6<span class="j_tdou_pay_goods_name" title="#{goods_full_name}">\u3010#{tdou_pay_goods_name}\u3011</span></div><div class="payment_desc_text">\u5151\u6362\u8be5\u5546\u54c1\u8fd8\u9700\u8981<span class="tdou_icon" title="T\u8c46"></span><span class="good_price_val j_tdou_need_pay">#{tdou_need_pay}</span>T\u8c46</div>'
		},
		getTdouPayInfoPaymentInfo_forMember: function() {
			return '<div class="payment_desc_text">\u60a8\u662f\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458\uff0c\u53ef\u514d\u8d39\u83b7\u53d6\u8be5\u5546\u54c1</div>'
		},
		getTdouPaymentErrorMain: function() {
			var _ = ['<div class="tdou_pay_error_box j_tdou_pay_error_box">', '  <a class="header_close j_header_close"></a>', '    <div class="tdou_pay_error_img_wrap"></div>', '    <div class="tdou_pay_error_text">', '      <div class = "tdou_pay_error_title " style="font-size: 18px;">', "#{error_text}", "        </div>", '        <div class = "tdou_pay_error_op">', '           <a class="tdou_pay_error_btn_close j_tdou_pay_error_btn_close" href="javascript:void(0)">\u5173\u95ed</a> ', '           <a class="tdou_pay_error_link"  target="_blank" href="/f?ie=utf-8&kw=t\u8c46\u5546\u57ce">\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458</a>', "        </div>", "    </div>", "</div>"].join("");
			return _
		},
		getTdouPaymentResultMain: function() {
			var _ = ['<div class="tdou_pay_result_box j_tdou_pay_result_box">', '  <a class="header_close j_header_close"></a>', '    <div class="tdou_pay_result_img_wrap"></div>', '    <div class="tdou_pay_result_text tdou_pay_result_text">', "#{result_html}", '        <div class = "tdou_pay_result_op">', '           <a class="tdou_pay_result_btn_close j_tdou_pay_result_btn_close" href="javascript:void(0)">\u5173\u95ed</a> ', "        </div>", "    </div>", "</div>"].join("");
			return _
		},
		getCashierIframe: function() {
			var _ = '<div class="tdou_base tdou_dianquan_base tdou_buy_dianquan_card"><div class="tdou_dianquan_header"><div class="header_title"><span class="header_icon"></span>\u8d2d\u4e70T\u8c46</div><div class="user_info"><span class="title_acc">\u8d26\u53f7\uff1a<span class="#{member}"></span><a class="title_acc_name">#{user_name}</a></span><span class="title_remain">T\u8c46\u4f59\u989d\uff1a<span class="title_remain_num"><span class="tdou_icon"></span><span  class="j_tdou">#{tdou_num}<span></span></span></span></div><a class="header_close j_header_close"></a></div><div class="tdou_cashier_wrap" id="tdou_cashier_wrap"><iframe id="tdou_cashier_iframe" src="#{cashier_url}" frameborder="0" style="border: 0"></iframe></div></div>';
			return _
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_builder",
	requires: ["encourage-payment/widget/tdou_template"],
	sub: {
		order_status: {
			1: "\u53d1\u8d27\u4e2d",
			2: "\u652f\u4ed8\u6210\u529f\uff0c\u53d1\u8d27\u6210\u529f",
			3: "\u652f\u4ed8\u6210\u529f\uff0c\u53d1\u8d27\u5931\u8d25\uff0c\u9000\u8fd8T\u8c46",
			4: "\u652f\u4ed8\u6210\u529f\uff0c\u53d1\u8d27\u8d85\u65f6\uff0c\u8bf7\u8054\u7cfb\u5546\u5bb6"
		},
		initial: function() {
			this.template = this.requireInstance("encourage-payment/widget/tdou_template")
		},
		builderGetTdouMain: function(t) {
			var e = this.template.getMainFrame(),
				o = this.builderGetTdouList(t);
			return $.tb.format(e, {
				list: o
			})
		},
		builderGetTdouList: function(t) {
			var e = "";
			if(t) {
				var o = this.template.getIconItem(),
					a = 0;
				for(var n in t) {
					var i = t[n];
					i.idx = a, i.price_diff = i.member_price - i.non_member_price, i.per_price = 100 * i.price_diff / i.non_member_price, e += $.tb.format(o, i), a++
				}
				return e
			}
		},
		builderLoading: function() {
			return this.template.getLoadingTpl()
		},
		builderMask: function() {
			return this.template.getMaskLayer()
		},
		builderTdouCheck: function() {
			return this.template.getTipInfoCheckPayInfoAndTdouInfo()
		},
		builderError: function(t) {
			var e = this.template.getTipInfoMainFrame(),
				o = {
					tip_img: "tip_failed_img",
					tdou_tip_text: "<div class='tdou_tip_error'><span class='tdou_tip_icon_name'>" + t + "</span>\u83b7\u53d6\u5931\u8d25\uff01\u8bf7\u5c1d\u8bd5\u91cd\u65b0\u83b7\u53d6\u6216\u5237\u65b0\u5f53\u524d\u9875\u9762\uff01</div>"
				};
			return $.tb.format(e, o)
		},
		builderIconTip: function(t, e, o) {
			var a = this.template.getIconInfoTip(),
				n = {
					icon_name: t,
					icon_expired: e,
					icon_desc: o
				};
			return $.tb.format(a, n)
		},
		buildGetIconSuccessTip: function(t) {
			var e = this.template.getTipInfoMainFrame(),
				o = "<span class='tdou_tip_error' style='margin-right: 10px'>\u8d2d\u4e70\u5370\u8bb0\u6210\u529f\uff0c\u83b7\u8d60T\u8c46\u6210\u529f</span><a href=\"/home/main?ie=utf-8&un=" + t + '&fr=new_icon" target="_blank">\u53bb\u6211\u7684\u4e2a\u4eba\u4e2d\u5fc3\u67e5\u770b>></a>',
				a = {
					tip_img: "tip_successed_img",
					tdou_tip_text: o
				};
			return $.tb.format(e, a)
		},
		builderPaymentFailed: function(t) {
			var e = this,
				o = this.template.getTipInfoMainFrame(),
				a = {
					tip_img: "tip_failed_img",
					tdou_tip_text: e.builderPaymentFailedText(t)
				};
			return $.tb.format(o, a)
		},
		builderPaymentFailedText: function(t) {
			return "<div class='tdou_tip_error'><span class='tdou_tip_icon_name'>\u3010" + t + "\u3011</span>\u5151\u6362\u5931\u8d25\uff01<a class='tdou_pay_error_link'  target='_blank' href='/f?ie=utf-8&kw=T%E8%B1%86%E5%95%86%E5%9F%8E%E5%90%A7'>\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458</a></div>"
		},
		buildPaymentSuccess: function(t, e, o, a) {
			var n = this,
				i = this.template.getTipInfoMainFrame(),
				r = n.buildPaymentSuccessText(t, e, o, a),
				d = {
					tip_img: "tip_successed_img",
					tdou_tip_text: r
				};
			return $.tb.format(i, d)
		},
		buildPaymentSuccessText: function(t, e, o, a) {
			var n = "<div class='tdou_tip_error' style='margin-right: 10px'>\u60a8\u5728" + (t || "\u5546\u57ce") + "\u83b7\u53d6\u7684\u3010" + e + "\u3011</div><div class='tdou_tip_error' style='margin-right: 10px'>" + this.order_status[a] + "</div>";
			return 2 == parseInt(a) && (n += "<div>\u4f7f\u7528<span class='tdou_icon'></span>" + o + "\u5151\u6362\u8be5\u5546\u54c1</div>"), n
		},
		build3rdOrderInfo: function(t) {
			var e = this.template.getTipInfoMainFrame(),
				o = "";
			if(t) {
				o += "<div class='tdou_tip_error' style='margin-right: 10px;margin-left:25px;margin-top:0'><ul style='list-style-type: disc;'>";
				for(var a in t) void 0 != a && (o += "<li><p class='tdou_tip_text_line'>" + t[a] + "</p></li>");
				o += "</ul></div>"
			} else o = "<div class='tdou_tip_error' style='margin-right: 10px;margin-left:15px'>\u8ba2\u5355\u5904\u7406\u5f02\u5e38</div>";
			var n = {
				tip_img: "tip_info_img_big",
				tdou_tip_text: o
			};
			return $.tb.format(e, n)
		},
		buildPayTdouMain_goodsInfo_getGoodsName: function(t) {
			return $.tb.subByte(t, 24, "")
		},
		buildPayTdouMain_goodsInfo: function(t) {
			var e = this,
				o = parseFloat(t.goods_price) * t.goods_amount,
				a = e.buildPayTdouMain_goodsInfo_getGoodsName(t.goods_name),
				n = {
					goods_name: e.escapeHTML(a),
					goods_full_name: t.goods_name,
					goods_img: t.goods_image,
					goods_info_amount_val: e.escapeHTML(e._convertNum(t.goods_amount)),
					goods_info_amount_unit: e.escapeHTML(t.goods_unit),
					goods_info_duration_val: e.escapeHTML(t.goods_duration),
					goods_info_duration_unit: "\u5929",
					good_price_val: e.escapeHTML(o)
				};
			parseInt(t.goods_duration) || (n.goods_info_duration_val = "\u6c38\u4e45", n.goods_info_duration_unit = "");
			var i = e.template.getTdouPayInfoGoodsInfoBase();
			return $.tb.format(i, n)
		},
		buildPayTdouMain_nonMemberGetGoodsOwnedMember: function(t, e, o, a) {
			var n = this,
				i = n.buildPayTdouMain_goodsInfo_getGoodsName(e.goods_name),
				r = n.buildPayTdouMain_goodsInfo(e),
				d = n.template.getTdouPayInfoPaymentInfoBase(),
				u = "",
				_ = "",
				m = "";
			t ? (m = {
				tdou_pay_from: e.tdou_pay_from,
				tdou_pay_goods_name: i,
				goods_full_name: e.goods_name,
				tdou_pay_need_tdou: e.tdou_num
			}, u = $.tb.format(n.template.getTdouPayInfoPaymentInfo_tdouEnough(), m), _ = n.template.getTdouPayInfoOpenMemberFreeGoodsTip() + $.tb.format(n.template.getTdouPayInfoPaymentInfoBtn_pay(), {
				tb_tdou_pay_btn: "\u7acb\u5373\u5151\u6362"
			}), _ += n.builder30CountConfirm(o.cpath)) : (m = {
				tdou_pay_from: e.tdou_pay_from,
				tdou_pay_goods_name: i,
				goods_full_name: e.goods_name,
				tdou_need_pay: a
			}, u = $.tb.format(n.template.getTdouPayInfoPaymentInfo_tdouNoEnough(), m), _ = n.template.getTdouPayInfoOpenMemberFreeGoodsTip() + n.template.getTdouPayInfoPaymentInfoBtn_get());
			var f = $.tb.format(d, {
					payment_desc: u,
					btn: _
				}),
				p = n.template.getTdouPayInfoMain();
			return $.tb.format(p, {
				sale_info: r,
				payment_info: f
			})
		},
		buildPayTdouMain_nonMemberGetTdouOwnedMember: function(t, e, o, a) {
			var n = this,
				i = n.buildPayTdouMain_goodsInfo_getGoodsName(e.goods_name),
				r = n.buildPayTdouMain_goodsInfo(e),
				d = n.template.getTdouPayInfoPaymentInfoBase(),
				u = "",
				_ = "",
				m = "";
			t ? (m = {
				tdou_pay_from: e.tdou_pay_from,
				tdou_pay_goods_name: i,
				goods_full_name: e.goods_name,
				tdou_pay_need_tdou: e.tdou_num
			}, u = $.tb.format(n.template.getTdouPayInfoPaymentInfo_tdouEnough(), m), _ = $.tb.format(n.template.getTdouPayInfoPaymentInfoTip(), {
				checkbox: ""
			}) + $.tb.format(n.template.getTdouPayInfoPaymentInfoBtn_pay(), {
				tb_tdou_pay_btn: "\u7acb\u5373\u5151\u6362"
			}), _ += n.builder30CountConfirm(o.cpath)) : (m = {
				tdou_pay_from: e.tdou_pay_from,
				tdou_pay_goods_name: i,
				goods_full_name: e.goods_name,
				tdou_need_pay: a
			}, u = $.tb.format(n.template.getTdouPayInfoPaymentInfo_tdouNoEnough(), m), _ = $.tb.format(n.template.getTdouPayInfoPaymentInfoTip(), {
				checkbox: '<span class="tdou_enable_member "><input type="checkbox" class="j_tdou_enable_member" /></span>'
			}) + n.template.getTdouPayInfoPaymentInfoBtn_get());
			var f = $.tb.format(d, {
					payment_desc: u,
					btn: _
				}),
				p = n.template.getTdouPayInfoMain();
			return $.tb.format(p, {
				sale_info: r,
				payment_info: f
			})
		},
		buildPayTdouMain_memberGetTdou: function(t, e, o, a) {
			var n = this,
				i = n.buildPayTdouMain_goodsInfo_getGoodsName(e.goods_name),
				r = n.buildPayTdouMain_goodsInfo(e),
				d = n.template.getTdouPayInfoPaymentInfoBase(),
				u = "",
				_ = "",
				m = "";
			if(t) {
				m = {
					tdou_pay_from: e.tdou_pay_from,
					tdou_pay_goods_name: i,
					goods_full_name: e.goods_name,
					tdou_pay_need_tdou: e.tdou_num
				};
				var f = "\u7acb\u5373\u5151\u6362";
				f = 2 == e.free_vip_level ? "\u514d\u8d39\u9886\u53d6" : "\u7acb\u5373\u5151\u6362", u = $.tb.format(n.template.getTdouPayInfoPaymentInfo_tdouEnough(), m), _ = n.template.getTdouPayInfoPaymentInfoByMember() + $.tb.format(n.template.getTdouPayInfoPaymentInfoBtn_pay(), {
					tb_tdou_pay_btn: f
				}), _ += n.builder30CountConfirm(o.cpath)
			} else m = {
				tdou_pay_from: e.tdou_pay_from,
				tdou_pay_goods_name: i,
				goods_full_name: e.goods_name,
				tdou_need_pay: a
			}, u = $.tb.format(n.template.getTdouPayInfoPaymentInfo_tdouNoEnough(), m), _ = n.template.getTdouPayInfoPaymentInfoByMember() + n.template.getTdouPayInfoPaymentInfoBtn_get();
			var p = $.tb.format(d, {
					payment_desc: u,
					btn: _
				}),
				s = n.template.getTdouPayInfoMain();
			return $.tb.format(s, {
				sale_info: r,
				payment_info: p
			})
		},
		buildPayTdouMain_memberGetTdou_freeGoods: function(t, e, o) {
			var a = this,
				n = a.buildPayTdouMain_goodsInfo(e),
				i = a.template.getTdouPayInfoPaymentInfoBase(),
				r = "",
				d = "",
				u = "\u514d\u8d39\u9886\u53d6";
			r = a.template.getTdouPayInfoPaymentInfo_forMember(), d = a.template.getTdouPayInfoPaymentInfoByMember() + $.tb.format(a.template.getTdouPayInfoPaymentInfoBtn_pay(), {
				tb_tdou_pay_btn: u
			}), t && (d += a.builder30CountConfirm(o.cpath));
			var _ = $.tb.format(i, {
					payment_desc: r,
					btn: d
				}),
				m = a.template.getTdouPayInfoMain();
			return $.tb.format(m, {
				sale_info: n,
				payment_info: _
			})
		},
		buildPayTdouMain_operation_panel: function(t) {
			var e = this,
				o = e.buildPayTdouMain_goodsInfo(t),
				a = e.template.getTdouPayInfoPaymentInfoPlaceHolder(),
				n = e.template.getTdouPayInfoMain();
			return $.tb.format(n, {
				sale_info: o,
				payment_info: a
			})
		},
		builder30CountConfirm: function(t) {
			return t && "1" == t.tip_exist ? this.template.getTdouPayInfoPaymentInfoPayConfirm() : ""
		},
		builderTdouPaymentResult: function(t) {
			var e = {
				result_html: t
			};
			return $.tb.format(this.template.getTdouPaymentResultMain(), e)
		},
		builderTdouPaymentError: function(t) {
			var e = {
				error_text: t
			};
			return $.tb.format(this.template.getTdouPaymentErrorMain(), e)
		},
		escapeHTML: function(t) {
			return "string" != typeof t ? t : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\s/g, "&nbsp;").replace(/'/g, "&#039;").replace(/"/g, "&quot;")
		},
		buildCashierIframe: function(t) {
			return $.tb.format(this.template.getCashierIframe(), t)
		},
		_convertNum: function(t) {
			return t > 99999999 ? Math.floor(t / 1e8) + "\u4ebf" : t > 9999999 ? Math.floor(t / 1e7) + "\u5343\u4e07" : t > 999999 ? Math.floor(t / 1e6) + "\u767e\u4e07" : t > 99999 ? Math.floor(t / 1e4) + "\u4e07" : t
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_view_operation_bootstrap",
	requires: ["encourage-payment/widget/tdou_builder", "encourage-payment/widget/umoney", "encourage-payment/widget/tdou_data"],
	sub: {
		$root: null,
		callbackOnClosed: null,
		initial: function() {
			var e = this;
			e.builder = e.requireInstance("encourage-payment/widget/tdou_builder"), e.umoney = e.requireInstance("encourage-payment/widget/umoney"), e.umoney.bind("closeDialogEvent", e.closeMain, e), e.dataProxy = e.requireInstance("encourage-payment/widget/tdou_data")
		},
		triggerByScene: function(e, o, n) {
			var i = this;
			if(i.scene_info = e || {}, i.callbackOnClosed = n, !o) return i.invokeCallbackOnClosed(), void 0;
			if("OPEN_CASHIER" === e.actionType) {
				var a = o.order_info.scene_id || "";
				i.dataProxy.getConsumerInfo({
					scene_id: a
				}, function(e) {
					$.extend(o.user_info, e), i.createMain(o)
				}, i)
			} else("CLOSE_CASHIER" === e.actionType || "CLOSE_PAYMENT" === e.actionType) && i.createMain(o)
		},
		createMain: function(e) {
			var o = this;
			if(e) {
				o.goods_info = e.goods_info, o.order_info = e.order_info, o.user_info = e.user_info, o.extra_options = e.extra_options;
				var n = o.createOperationUI();
				if(!n) return o.invokeCallbackOnClosed(), void 0;
				var i = o.builder.buildPayTdouMain_operation_panel(o.goods_info);
				o.renderMain(i), o.bindEvents(), o.$root.find(".j_payment_place_holder").append(n)
			}
		},
		createOperationUI: function() {
			var e = this,
				o = {
					isRecharge: e.user_info.isRecharge,
					isConsumption: e.user_info.isConsumption,
					isMember: e.isMember(),
					isGoodsFreeForMember: e.goods_info.free_vip_level,
					actionType: e.scene_info.actionType
				},
				n = e.umoney.getMainUIDom(o);
			return n
		},
		renderMain: function(e) {
			var o = "baidu_tb_tdou_operation_boot";
			if(!($("." + o).length > 0)) {
				var n = {
					modal: !0,
					showTitle: !1,
					fixed: !0,
					width: 610,
					height: 275,
					holderClassName: o,
					html: e,
					draggable: !0
				};
				this._dialog = new $.dialog(n), this._dialog.show(), this.$root = this._dialog.element
			}
		},
		bindEvents: function() {
			var e = this;
			e.$root.on("click", ".j_tdou_pay_header_close", function() {
				e.closeMain()
			})
		},
		closeMain: function() {
			var e = this;
			e.$root.find(".j_tdou_pay_header_close").off("click"), e._dialog && e._dialog.close(), e.dialog = null, e.invokeCallbackOnClosed()
		},
		invokeCallbackOnClosed: function() {
			var e = this,
				o = e.callbackOnClosed;
			$.isFunction(o) && o()
		},
		isMember: function() {
			var e = this,
				o = e.user_info.Parr_props;
			e.dataProxy.setParrProps(o);
			var n = e.dataProxy.getMemberLevel();
			return 2 == n
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_view_cashier",
	requires: ["encourage-payment/widget/tdou_data", "encourage-payment/widget/tdou_builder", "tbui/widget/messenger", "encourage-payment/widget/tdou_view_operation_bootstrap"],
	sub: {
		sub_iframe_name: "tdou_cashier_iframe",
		windowId: "window_iframe_app_" + (new Date).getMilliseconds(),
		_iframe_dialog: null,
		initial: function(e) {
			e = $.extend({}, e);
			e.scores, e.level;
			this.dataProxy = this.requireInstance("encourage-payment/widget/tdou_data", {
				scores: e.scores,
				level: e.level
			}), this.builder = this.requireInstance("encourage-payment/widget/tdou_builder")
		},
		showDialog: function(e, a) {
			var i = this;
			i.pay_info = a, i._iframe_dialog && $(".tdou_pay_cashier_iframe_dialog").remove(), e && (e += "&embed=1");
			var t = {
					user_name: i.dataProxy.getUserName(),
					tdou_num: 0,
					member: i.dataProxy.getMemberIcon(),
					cashier_url: e
				},
				n = i.builder.buildCashierIframe(t),
				o = {
					modal: !0,
					showTitle: !1,
					fixed: !0,
					width: 726,
					height: 610,
					hideOnclose: !1,
					holderClassName: "tdou_pay_cashier_iframe_dialog",
					draggable: !0,
					html: n
				};
			i._iframe_dialog = new $.dialog(o), i._iframe_dialog.show(), i.updateTdou(), i.wrap = i._iframe_dialog.element, window.tdou_dianquan_iframe_dialog = i._iframe_dialog, i.track("show"), i.bindEvent(), i.initMessager()
		},
		bindEvent: function() {
			var e = this;
			e.wrap.find(".j_header_close").on("click", function() {
				e.closeMain()
			})
		},
		closeMain: function() {
			var e = window.tdou_dianquan_iframe_dialog;
			e && e.close(), delete window.tdou_dianquan_iframe_dialog, this.track("\u5173\u95ed\u7a97\u53e3"), this.triggerActionOnClosed()
		},
		initMessager: function() {
			var e = this;
			if(!window.messenger) {
				e.MessageInstance = e.requireInstance("tbui/widget/messenger", [this.windowId, "tdou_pay"]);
				var a = window.document.getElementById(e.sub_iframe_name);
				e.MessageInstance.addTarget(a.contentWindow, e.sub_iframe_name);
				var i = ["http://db.baidu.com", "http://pay.baidu.com"];
				e.MessageInstance.registerOrigin(i), e.MessageInstance.registerCommand({
					encourage_dianquan_readystatechange: $.proxy(e.onReadyStateChange, this),
					encourage_dianquan_close: $.proxy(e.onClose, this)
				})
			}
		},
		sendMessage: function(e) {
			var a = this;
			if(a.MessageInstance) {
				var i = "";
				"object" == typeof e && (i = JSON.stringify(e)), a.MessageInstance.targets[a.sub_iframe_name].send(i)
			}
		},
		onReadyStateChange: function(e) {
			if(e) switch(e.status) {
				case 2e3:
					this.updateTdou(), this.track("\u652f\u4ed8\u6210\u529f");
					break;
				case 3e3:
					this.onClose();
					break;
				case 3001:
					this.onClose(), this.track("\u518d\u6b21\u8d2d\u4e70")
			}
		},
		onClose: function() {
			this.closeMain()
		},
		updateTdou: function() {
			var e = this;
			e.dataProxy.getTdou(function(e) {
				if(e && 0 === e.no) {
					var a = e.data.Parr_scores,
						i = a ? a.scores_money + a.scores_other : 0;
					$(".tdou_pay_cashier_iframe_dialog .j_tdou").html(i)
				}
			}, this)
		},
		triggerActionOnClosed: function() {
			var e = this,
				a = e.requireInstance("encourage-payment/widget/tdou_view_operation_bootstrap"),
				i = {
					actionType: "CLOSE_CASHIER"
				};
			a.triggerByScene(i, e.pay_info)
		},
		track: function(e) {
			$.stats.track("tdoupay", "cashierDialog", PageData.product, e || "click")
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_view_util",
	requires: ["encourage-payment/widget/tdou_builder", "tbui/widget/login_dialog"],
	sub: {
		_wrap: null,
		initial: function() {
			this.builder = this.requireInstance("encourage-payment/widget/tdou_builder")
		},
		setMask: function(i) {
			var e = this;
			this._wrap = i || $("body");
			var t = {
					height: e._wrap.height(),
					width: e._wrap.width()
				},
				a = this._wrap.find(".j_tdou_mask");
			if(0 == a.length) {
				var o = this.builder.builderMask();
				a = $(o), e._wrap.prepend(a)
			}
			a.css(t), a.show()
		},
		removeMask: function() {
			var i = this._wrap.find(".j_tdou_mask");
			0 != i.length && i.hide()
		},
		displayLoading: function(i) {
			var e = this;
			this._wrap = i || $("body");
			var t = (e._wrap.height() - 70) / 2 + "px",
				a = (e._wrap.width() - 200) / 2 + "px",
				o = {
					top: t,
					left: a
				},
				n = this._wrap.find(".j_tdou_get_icon_loading");
			if(0 == n.length) {
				var d = this.builder.builderLoading();
				n = $(d), e._wrap.prepend(n)
			}
			e.setMask(i), n.css(o), n.show()
		},
		hideLoading: function() {
			var i = this._wrap.find(".j_tdou_get_icon_loading");
			0 != i.length && i.hide(), this.removeMask()
		},
		_displayInfo: function(i, e, t, a, o, n) {
			var d = this;
			d._wrap = i || $("body");
			var r = (d._wrap.height() - (o || 80)) / 2 + "px",
				l = (d._wrap.width() - (n || 400)) / 2 + "px",
				_ = {
					top: r,
					left: l
				},
				s = $(e);
			d.setMask(i), d._wrap.append(s), s.css(_), s.show(), setTimeout(function() {
				d._hideInfo(), t && t.call(a)
			}, 3e3)
		},
		_hideInfo: function() {
			this._wrap.find(".j_tdou_get_icon_tip").remove(), this.removeMask()
		},
		displayErrorInfo: function(i, e, t, a) {
			var o = this,
				n = o.builder.builderError(e);
			o._displayInfo(i, n, t, a)
		},
		hideErrorinfo: function() {
			this._hideInfo()
		},
		dispalySuccessedInfo: function(i, e, t, a) {
			var o = this,
				n = o.builder.buildGetIconSuccessTip(e);
			o._displayInfo(i, n, t, a)
		},
		dispaly3rdOrderInfo: function(i, e, t, a) {
			var o = this,
				n = o.builder.build3rdOrderInfo(e);
			o._displayInfo(i, n, t, a, 100, 420)
		},
		showIconTip: function(i, e, t) {
			var a = this,
				o = i;
			this._icon = e;
			var n = a._icon.position(),
				d = n.top - 60 + "px",
				r = {
					top: d,
					right: 85
				};
			if(this.$tip = o.find(".j_tdou_get_icon_info_tip"), 0 == this.$tip.length) {
				var l = this.builder.builderIconTip(t.icon_name, t.icon_expired, t.icon_desc);
				this.$tip = $(l), o.append(this.$tip)
			} else this.$tip.find(".j_icon_name").html(t.icon_name), this.$tip.find(".j_icon_expired").html(t.icon_expired), this.$tip.find(".j_icon_desc").html(t.icon_desc);
			this.$tip.css(r), this.$tip.show()
		},
		hideIconTip: function() {
			this.$tip && this.$tip.hide()
		},
		OpenLoginDialog: function() {
			this.requireInstance("tbui/widget/login_dialog")
		},
		displayPaymentFailed: function(i, e, t, a) {
			var o = this,
				n = "";
			null != i ? (n = o.builder.builderPaymentFailed(e), o._displayInfo(i, n, t, a)) : (n = o.builder.builderPaymentFailedText(e), o.displayPaymentResult(n, t, a))
		},
		displayPaymentSuccess: function(i, e, t, a, o) {
			var n = this,
				d = e.from,
				r = e.goods_name,
				l = e.price,
				_ = e.order_status,
				s = "";
			null != i ? o ? t && t.call(a) : (s = n.builder.buildPaymentSuccess(d, r, l, _), n._displayInfo(i, s, t, a)) : o ? t && t.call(a) : (s = n.builder.buildPaymentSuccessText(d, r, l, _), n.displayPaymentResult(s, t, a))
		},
		displayPaymentError: function(i) {
			var e = this;
			if(!($(".baidu_tb_tdou_payment_error_dialog").length > 0)) {
				var t = i || "\u652f\u4ed8\u5f02\u5e38\uff1a\u5e94\u7528\u8fd8\u6ca1\u6709\u5f00\u542f\u652f\u4ed8\u529f\u80fd",
					a = this.builder.builderTdouPaymentError(t),
					o = {
						modal: !0,
						showTitle: !1,
						fixed: !0,
						width: 420,
						height: 150,
						holderClassName: "baidu_tb_tdou_payment_error_dialog",
						draggable: !0,
						html: a
					};
				e._pay_error_dialog = new $.dialog(o), e._pay_error_dialog.show();
				var n = function() {
					e._pay_error_dialog && e._pay_error_dialog.close(), e._pay_error_dialog = null
				};
				e._pay_error_dialog.element.delegate(".j_header_close", "click", function() {
					n()
				}).delegate(".j_tdou_pay_error_btn_close", "click", function() {
					n()
				})
			}
		},
		displayPaymentResult: function(i, e, t) {
			var a = this;
			if(!($(".baidu_tb_tdou_payment_result_dialog").length > 0)) {
				i = this.builder.builderTdouPaymentResult(i);
				var o = {
					modal: !0,
					showTitle: !1,
					fixed: !0,
					width: 520,
					height: 200,
					holderClassName: "baidu_tb_tdou_payment_result_dialog",
					draggable: !0,
					html: i
				};
				a._pay_result_dialog = new $.dialog(o), a._pay_result_dialog.show();
				var n = function() {
					a._pay_result_dialog && a._pay_result_dialog.close(), a._pay_result_dialog = null
				};
				setTimeout(function() {
					n(), e && e.call(t)
				}, 3e3), a._pay_result_dialog.element.delegate(".j_header_close", "click", function() {
					n()
				}).delegate(".j_tdou_pay_result_btn_close", "click", function() {
					n()
				})
			}
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_view_auto_redirect",
	requires: ["encourage-payment/widget/tdou_builder", "encourage-payment/widget/tdou_data", "encourage-payment/widget/tdou_view_util", "encourage-payment/widget/tdou_open_type", "encourage-payment/widget/qianbao_purchase_tdou", "encourage-payment/widget/tdou_view_cashier", "encourage-payment/widget/tdou_view_operation_bootstrap"],
	sub: {
		_icon_id: "suiji",
		display_type: "get_icon",
		CASHIER: 1,
		QIANBAO: 2,
		PayMemberUrl: "/tbmall/getMyPayType",
		third_order_id: "",
		initial: function() {
			this.builder = this.requireInstance("encourage-payment/widget/tdou_builder"), this.dataProxy = this.requireInstance("encourage-payment/widget/tdou_data"), this.viewUtil = this.requireInstance("encourage-payment/widget/tdou_view_util"), this.openTypeList = this.requireInstance("encourage-payment/widget/tdou_open_type")
		},
		createMain: function(e) {
			var t = this;
			e = e || {}, t.return_url = $.tb.location.getHref(), t.consumption_path = e.consumption_path, t.desc = e.title, t.current_need_tdou = e.need_tdou, t.goods_cost_tdou = e.goods_cost_tdou, t.pay_type = e.pay_type, t.tbs = e.tbs, t.third_order_id = e.third_order_id || e.order_id, t.pay_info = e.pay_info;
			var a = e.is_dialog;
			e.is_dialog = this.openTypeList.getOpenType(e.consumption_path);
			var i = !1,
				o = window.PageData.user.id;
			if(2100006 === e.consumption_path ? i = !0 : $.cookie("newcashier") ? i = !0 : $.cookie("nonewcashier") ? i = !1 : a ? i = !1 : ("732964586" === o || "963463500" === o || "1496" === o) && (i = !0), i) {
				var r, n = e.consumption_path,
					d = t.third_order_id;
				return r = d ? $.param({
					margin: e.goods_cost_tdou,
					thirdOrderId: d,
					sceneId: e.consumption_path,
					fromUrl: $.tb.location.getHref(),
					fr: n
				}) : $.param({
					margin: e.need_tdou,
					fr: n,
					fromUrl: $.tb.location.getHref()
				}), window.open("/tbmall/cashier?" + r), void 0
			}
			"win" === e.is_dialog && (t.new_win = window.open("about:blank")), t.dataProxy.getIconInfo(t.onGetIconInfo, t, t.return_url)
		},
		onGetIconInfo: function(e) {
			var t = this;
			if(e && 0 === e.no) {
				if(!t.dataProxy.isLogin()) return this.viewUtil.OpenLoginDialog(), void 0;
				t.afterUpdateTdou()
			} else e && 11e4 === e.no && this.viewUtil.OpenLoginDialog()
		},
		afterUpdateTdou: function() {
			var e = this,
				t = e.current_need_tdou,
				a = e._icon_id;
			e.pay_channel = 2, e.pay_type = 6, e.return_url = e.getPageUrl(), e.dataProxy.payIconWithMargin(a, t, e.buyIcon, e, e.return_url, e.consumption_path, e.goods_cost_tdou, e.pay_type, e.tbs, e.third_order_id, e.pay_channel)
		},
		builderMainUI: function() {
			var e = this.builder.builderTdouCheck();
			this.renderMain(e);
			var t = $(".j_tdou_get_icon_check");
			this.bindMainUIEvents(t), t.css({
				"z-index": "900"
			}), this.wrap = $("#tdou_pay_icon_check_dialog")
		},
		renderMain: function(e) {
			var t = {
				modal: !0,
				showTitle: !1,
				fixed: !1,
				width: 538,
				height: 208,
				holderClassName: "tdou_pay_icon_check_dialog",
				draggable: !0
			};
			t.html = e, this._dialog = new $.dialog(t), this._dialog.element[0].id = "tdou_pay_icon_check_dialog", this._dialog.show()
		},
		bindMainUIEvents: function(e) {
			var t = this;
			e && e.delegate(".j_header_close", "click", function() {
				t.closeMain()
			}).delegate(".j_check_btn", "click", function() {
				"get_icon" == t.display_type ? t.updateTdou() : "third_app" == t.display_type && t.displayThirdApp()
			}).delegate(".j_btn_redo_check", "click", function() {
				t.closeMain()
			})
		},
		buildCashierIframe: function(e) {
			var t = this,
				a = t.pay_channel;
			if(!this.cashier)
				if(2 == a) {
					this.cashier = this.requireInstance("encourage-payment/widget/qianbao_purchase_tdou");
					var i = e,
						o = $.extend({
							product: "tdou",
							consumption_path: t.consumption_path,
							goods_cost_tdou: t.goods_cost_tdou,
							pay_type: t.pay_type,
							goods_order_id: t.third_order_id,
							pay_channel: t.pay_channel
						}, {
							qianbao_params: i.return_url,
							iconCount: i.iconCount,
							iconId: i.iconId
						}),
						r = {
							ie: "utf-8",
							tbs: t.tbs,
							terminal: "pc",
							pay_type: t.pay_type,
							iconId: t._icon_id,
							pageUrl: t.return_url || "",
							margin: t.current_need_tdou,
							goodsCost: t.goods_cost_tdou,
							fr: t.consumption_path || 0,
							third_order_id: t.third_order_id,
							channel: t.pay_channel
						};
					this.cashier.showDialog(o, r)
				} else this.cashier = this.requireInstance("encourage-payment/widget/tdou_view_cashier"), this.cashier.showDialog(e, this.pay_info)
		},
		closeMain: function() {
			this._dialog.close(), this.cashier = null, this.dataProxy.clearCache()
		},
		buyIcon: function(e) {
			var t = this;
			if(t.wrap = $("#tdou_pay_icon_check_dialog"), e && 0 === e.no)
				if(t.builderMainUI(), t.new_win) t.new_win.location.href = e.data || "";
				else {
					var a = t.requireInstance("encourage-payment/widget/tdou_view_operation_bootstrap"),
						i = {
							actionType: "OPEN_CASHIER"
						};
					a.triggerByScene(i, t.pay_info, function() {
						t.buildCashierIframe(e.data || "")
					})
				}
			else if(e && 11e4 === e.no) t.closeMain(), t.viewUtil.OpenLoginDialog(), t.new_win && t.new_win.close();
			else if(e && 1990055 === e.error_code)
				if("undefined" == typeof passport || "undefined" == typeof passport.pop.init) {
					var o = "undefined" != typeof Env && Env.server_time ? Env.server_time : (new Date).getTime(),
						r = "https://passport";
					$.JsLoadManager.use([r + ".baidu.com/passApi/js/uni_login_wrapper.js?cdnversion=" + Math.floor(o / 6e4), r + ".baidu.com/passApi/js/wrapper.js?cdnversion=" + Math.floor(o / 6e4)], function() {
						window.realname = passport.pop.init({
							type: "accRealName",
							apiOpt: {
								product: "tb",
								staticPage: "//tieba.baidu.com/tb/static-common/html/pass/v3Jump.html"
							},
							tangram: !0,
							color: "green"
						}), window.realname.show()
					}, !0, "utf-8")
				} else window.realname.show();
			else this.viewUtil.displayErrorInfo(t.wrap, ""), t.new_win && t.new_win.close()
		},
		updateTdou: function() {
			var e = this;
			e.dataProxy.getTdou(e.onUpdateTdou, e)
		},
		onUpdateTdou: function(e) {
			var t = this;
			if(e && 0 === e.no) {
				var a = e.data.Parr_scores,
					i = a ? a.scores_money + a.scores_other : 0,
					o = t.dataProxy.getUserTdou();
				if(i - o >= 1e4) {
					t.wrap = $("#tdou_pay_icon_check_dialog");
					var r = t.dataProxy.getUserName();
					this.viewUtil.dispalySuccessedInfo(t.wrap, r, function() {
						t.closeMain()
					}, t)
				} else this.viewUtil.displayErrorInfo(t.wrap, "", function() {
					t.closeMain()
				}, t)
			}
		},
		updateTdouAndUserName: function(e) {
			var t = this;
			t.dataProxy.getTdou(t.onUpdateTdouAndUserName, t, e)
		},
		onUpdateTdouAndUserName: function(e, t) {
			var a = this;
			if(e && 0 === e.no) {
				var i = e.data.mParr_props,
					o = e.data.Parr_scores;
				a.dataProxy.setParrProps(i), a.dataProxy.setParrScores(o), t && t.call(this)
			}
		},
		displayThirdApp: function() {
			var e = this;
			e.dataProxy.getThirdOrderInfo(e.onDisplayThirdApp, e, e.third_order_id)
		},
		onDisplayThirdApp: function(e) {
			var t = this;
			if(e && 0 === e.no) {
				var a = e.data.user_info.Parr_scores,
					i = e.data.order_info,
					o = a ? a.scores_money + a.scores_other : 0,
					r = t.dataProxy.getCacheUserTotalTdou(),
					n = "",
					d = parseInt(i.status),
					s = !1;
				switch(s = d >= 1 ? !0 : o - r >= 1e4, parseInt(t.pay_type)) {
					case 6:
						n = {
							get_tdou: o - r >= 1e4 ? "\u83b7\u53d6T\u8c46\u6210\u529f" : "\u83b7\u53d6T\u8c46\u5931\u8d25"
						};
						break;
					case 7:
						n = {
							get_tdou: o - r >= 0 ? "\u83b7\u53d6T\u8c46\u6210\u529f" : "\u83b7\u53d6T\u8c46\u5931\u8d25",
							is_member: t.dataProxy.isMemeber() ? "\u5f00\u901a\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458\u6210\u529f" : "\u5f00\u901a\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458\u5931\u8d25"
						};
						break;
					case 8:
						n = {
							order_status: t.getOrderStatus(i.status),
							get_tdou: s ? "\u83b7\u53d6T\u8c46\u6210\u529f" : "\u83b7\u53d6T\u8c46\u5931\u8d25"
						};
						break;
					case 9:
						n = {
							order_status: t.getOrderStatus(i.status),
							get_tdou: s ? "\u83b7\u53d6T\u8c46\u6210\u529f" : "\u83b7\u53d6T\u8c46\u5931\u8d25",
							is_member: t.dataProxy.isMemeber() ? "\u5f00\u901a\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458\u6210\u529f" : "\u5f00\u901a\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458\u5931\u8d25"
						};
						break;
					default:
						n = {
							error: "\u6307\u5b9a\u7684\u652f\u4ed8\u7c7b\u578b\u53c2\u65e0\u6548"
						}
				}
				t.wrap = $("#tdou_pay_icon_check_dialog"), t.viewUtil.dispaly3rdOrderInfo(t.wrap, n, function() {
					t.closeMain()
				}, t)
			} else t.viewUtil.displayErrorInfo(t.wrap, "", function() {
				t.closeMain()
			})
		},
		getPageUrl: function() {
			var e = $.tb.location.getHref();
			return e = e.replace(/&customerId=.*|\?customerId=.*/g, "")
		},
		getOrderStatus: function(e) {
			var t = {
				0: "\u3010\u652f\u4ed8\u672a\u5b8c\u6210\u3011",
				1: "\u652f\u4ed8\u6210\u529f\uff0c\u5546\u54c1\u5151\u6362\u4e2d\uff01",
				2: "\u5151\u6362\u6210\u529f",
				3: "\u5151\u6362\u5931\u8d25\uff0cT\u8c46\u5df2\u9000\u8fd8",
				4: "\u5151\u6362\u8d85\u65f6\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458"
			};
			return t[e]
		},
		isQianbaoHitSmallFlow: function() {
			var e = PageData && PageData.user && PageData.user.id;
			return e ? "1157380926" == e || "707573940" == e || "963463500" == e || "1093896819" == e || "1496" == e || "1134652730" == e || "982451133" == e ? !0 : (e = parseInt(e, 10), e % 1 === 0) : !1
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/umoney_query",
	sub: {
		url: {
			queryCredit: "/tbapp/umoney/queryUserInfo",
			queryQualification: "/tbapp/umoney/queryQualification"
		},
		query_umoney_cls: ".j-query-umoney",
		umoneyInfoStatus: {
			s1: "\u672a\u7533\u8bf7",
			s2: "\u5ba1\u6838\u4e2d",
			s3: "\u6b63\u5e38",
			s4: "\u903e\u671f",
			s5: "\u51bb\u7ed3",
			s6: "\u5931\u8d25"
		},
		initial: function() {
			var e = this;
			e.$element = $(".tdou-umoney-query")
		},
		showUmoney: function(e) {
			var n = this,
				t = $.tb.format('<div class="tdou-umoney-query">          <span class="umoney-user">              #{displayText}:              <a class="j-query-umoney " href="javascript:void(0);"                 title="\u67e5\u770b\u6709\u94b1\u989d\u5ea6"                 locate="userinfo#\u767e\u5ea6\u6709\u94b1">                  \u67e5\u770b              </a>          </span>          <span class="umoney-placeholder">              <a target="_blank" href="/f?ie=utf-8&kw=\u767e\u5ea6\u6709\u94b1\u6d88\u8d39\u91d1\u878d"                 locate="userinfo#\u767e\u5ea6\u6709\u94b1">                  \u767e\u5ea6\u6709\u94b1\u9001T\u8c46              </a>          </span>  </div>', {
					displayText: e || "\u767e\u5ea6\u6709\u94b1\u989d\u5ea6"
				});
			return n.getUmoneyDom(t)
		},
		showUmoneyOnGotTdou: function() {
			var e = this,
				n = '<div class="tdou-umoney-query umoney-query-get-tdou">      <span class="umoney-placeholder">\u63d0\u9192\uff1a\u60a8\u5728 pc\u53ca\u5b89\u5353\u4e0a\u83b7\u53d6\u7684T\u8c46\u4e0e\u5728ios\u4e0a\u83b7\u53d6\u7684T\u8c46\u4e0d\u901a\u7528\u3002</span>  </div>',
				t = e.getUmoneyDom(n);
			return t
		},
		showUmoneyMember: function() {
			var e = this,
				n = '<div class="tdou-umoney-query tshow-tdou-umoney-query">      <a  target="_blank" href="/f?ie=utf-8&kw=\u767e\u5ea6\u6709\u94b1\u6d88\u8d39\u91d1\u878d" locate="tshow-bar#\u767e\u5ea6\u6709\u94b1">          <span class="umoney-logo"></span>\u4f7f\u7528\u767e\u5ea6\u6709\u94b1\u8d2d\u4e70\u8d34\u5427\u4f1a\u5458\u4f18\u60e0          <span class="vip-red vip-discount">5%</span>      </a>  </div>';
			return e.$element = $(n), e.$element
		},
		getUmoneyDom: function(e) {
			var n = this;
			return this.$element = $(e), n.isUmoneyUser(), n.$element
		},
		bindEvents: function() {
			var e = this;
			e.$element.on("click", e.query_umoney_cls, function() {
				e.queryUmoneyCredit()
			})
		},
		queryUmoneyCredit: function() {
			var e = this;
			e._queryUmoneyCredit && e._queryUmoneyCredit.abort(), e._queryUmoneyCredit = $.ajax({
				type: "GET",
				url: e.url.queryCredit,
				data: {},
				cache: !1,
				dataType: "json"
			}).success(function(n) {
				if(e._queryUmoneyCredit = null, 0 == n.no) {
					var t = n.data && n.data.data;
					e.showCredit(t)
				}
			})
		},
		isUmoneyUser: function() {
			var e = this;
			e._isUmoneyUser && e._isUmoneyUser.abort(), e._isUmoneyUser = $.ajax({
				type: "GET",
				url: e.url.queryCredit,
				data: {},
				cache: !1,
				dataType: "json"
			}).success(function(n) {
				if(e._isUmoneyUser = null, 0 == n.no) {
					var t = n.data && n.data.data.status;
					"1" != t && (e.$element.find(".umoney-placeholder").end().find(".umoney-user").show(), e.bindEvents())
				} else e.$element.find(".umoney-user").hide().end().find(".umoney-placeholder").show()
			})
		},
		showCredit: function(e) {
			if(e) {
				var n = this,
					t = "";
				if(3 === e.status) {
					var o = e.credit || 0;
					t = o + "\u5143 "
				} else t = n.umoneyInfoStatus["s" + e.status];
				var s = t + ",\u70b9\u51fb\u5237\u65b0";
				n.$element.find(n.query_umoney_cls).html(t).addClass("umoney-credit").tbattr("title", s)
			}
		},
		track: function(e) {
			$.stats.track(e, "umoney-query", "", "click")
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_view_check",
	requires: ["encourage-payment/widget/tdou_builder", "encourage-payment/widget/tdou_data", "encourage-payment/widget/tdou_view_util"],
	sub: {
		initial: function() {
			this.builder = this.requireInstance("encourage-payment/widget/tdou_builder"), this.dataProxy = this.requireInstance("encourage-payment/widget/tdou_data"), this.viewUtil = this.requireInstance("encourage-payment/widget/tdou_view_util")
		},
		showTdouCheckView: function(e, i, t) {
			var n = this;
			n._wrap = e || $("body");
			var o = (n._wrap.height() - 208) / 2 + "px",
				c = (n._wrap.width() - 520) / 2 + "px",
				d = {
					top: o,
					left: c
				},
				u = n._wrap.find(".j_tdou_get_icon_check");
			if(0 == u.length) {
				var a = this.builder.builderTdouCheck();
				u = $(a), n._wrap.prepend(u), n._bindEvents(u, i, t)
			}
			n.viewUtil.setMask(e), u.css(d), u.show()
		},
		hideTdouCheckView: function() {
			var e = this._wrap.find(".j_tdou_get_icon_check");
			e.hide(), this.viewUtil.removeMask()
		},
		_bindEvents: function(e, i, t) {
			var n = this;
			e && e.on("click", ".j_header_close", function() {
				n.hideTdouCheckView()
			}).on("click", ".j_check_btn", function() {
				n.hideTdouCheckView(), "function" == typeof i && n._onCheckTdou(i, t)
			}).on("click", ".j_btn_redo_check", function() {
				n._onRedoBuyIcon()
			})
		},
		_onCheckTdou: function(e, i) {
			"function" == typeof e && "object" == typeof i && e.call(i)
		},
		_onRedoBuyIcon: function() {
			this.hideTdouCheckView()
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_counter",
	sub: {
		onValueChange: [],
		initial: function() {},
		builderUI: function(t) {
			var a = ['<div id="tdou_counter_#{id}" class="tdou_calc_count j_tdou_calc_count">', '    <button class="tdou_calc_op tdou_calc_minus j_tdou_calc_minus">-</button>', '    <input class="tdou_calc_input j_tdou_calc_input" type="text" value="1"/>', '    <button  class="tdou_calc_op tdou_calc_add j_tdou_calc_add">+</button>', "</div>"].join(""),
				n = $.tb.format(a, {
					id: t
				});
			return n
		},
		bindEvents: function(t) {
			var a = this;
			if(t) {
				var n = 999999,
					c = t.find(".j_tdou_calc_input"),
					e = t[0].id.replace("tdou_counter_", "");
				t.delegate(".j_tdou_calc_minus", "click", function() {
					var t = parseInt(c.val()) || 1;
					t = Math.max(1, t - 1), t = Math.min(n, t), c.val(t), a.triggerValChange(t, e)
				}).delegate(".j_tdou_calc_add", "click", function() {
					var t = parseInt(c.val()) || 1;
					t++, t = Math.min(n, t), c.val(t), a.triggerValChange(t, e)
				}).delegate(".j_tdou_calc_input", "input propertychange", function() {
					var t = /^[1-9]\d*$/,
						o = c.val();
					(o && !t.test(o) || t.test(o) && o > 999) && (o = o.replace(/\D/g, "").replace(/^0(\d*)$/, "$1"), o = Math.min(n, o), c.val(o), a.triggerValChange(o, e))
				});
				var o = function() {
					var t = c.val() && parseInt(c.val()) > 0 && parseInt(c.val()) || 1;
					t = Math.min(n, t), c.val(t), a.triggerValChange(t, e)
				};
				c.on("blur", function() {
					o()
				}).on("keydown", function(t) {
					13 == t.keyCode && o()
				})
			}
		},
		triggerValChange: function(t, a) {
			for(var n = 0; n < this.onValueChange.length; n++) {
				var c = this.onValueChange[n];
				c.action && "function" == typeof c.action && c.context && c.action.call(c.context, t, a)
			}
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou_view",
	requires: ["encourage-payment/widget/tdou_builder", "encourage-payment/widget/tdou_data", "encourage-payment/widget/tdou_counter", "encourage-payment/widget/tdou_view_util", "encourage-payment/widget/tdou_view_check", "encourage-payment/widget/TdouOpenType", "encourage-payment/widget/qianbao_purchase_tdou", "encourage-payment/widget/umoney_query"],
	sub: {
		PayMemberUrl: "/tbmall/getMyPayType",
		CASHIER: 1,
		QIANBAO: 2,
		initial: function(e) {
			e = $.extend({}, e);
			e.scores, e.level;
			this.builder = this.requireInstance("encourage-payment/widget/tdou_builder"), this.dataProxy = this.requireInstance("encourage-payment/widget/tdou_data", {
				scores: e.scores,
				level: e.level
			}), this.counter = this.requireInstance("encourage-payment/widget/tdou_counter"), this.viewUtil = this.requireInstance("encourage-payment/widget/tdou_view_util"), this.checkTdou = this.requireInstance("encourage-payment/widget/tdou_view_check"), this.openTypeList = this.requireInstance("encourage-payment/widget/TdouOpenType", {
				type: "tdou"
			})
		},
		createMain: function(e, t, n, o) {
			var a = this;
			a.consumption_path = e, a.desc = t, a.current_need_tdou = n, a.is_direct_cashier = o;
			var i = $.tb.location.getHref();
			a.openType = a.openTypeList.getOpenType(e), a.dataProxy.getIconInfo(a.builderMainUI, a, i)
		},
		builderMainUI: function(e) {
			var t = this;
			if(e && 0 === e.no) {
				var n = e.data,
					o = t.builder.builderGetTdouMain(n);
				t.renderMain(o), t.bindMainUIEvents(), t.dataProxy.isLogin() || $(".j_tdou_body_title").hide(), t.setDefaultSlected(), t.addUmoney()
			} else e && 11e4 === e.no && this.viewUtil.OpenLoginDialog()
		},
		renderMain: function(e) {
			var t = "tdou_pay_icon_dialog",
				n = {
					modal: !0,
					showTitle: !1,
					fixed: !0,
					width: 620,
					height: 545,
					holderClassName: t,
					draggable: !0
				};
			n.html = e, this._dialog = new $.dialog(n), this._dialog.element[0].id = t, this._dialog.show()
		},
		setDefaultSlected: function() {
			$(".j_tdou_base_list li:eq(1)").trigger("click")
		},
		bindMainUIEvents: function() {
			var e = this;
			e.bindCounterEvent(), $(".j_header_close").on("click", function() {
				e.trigger("after_buy_icon"), e.closeMain()
			}), $(".j_tdou_give_btn_big").on("click", function() {
				e.trigger("after_buy_icon"), e.closeMain()
			}), $(".j_tdou_get_item").on("click", function() {
				var t = $(this);
				e.selectIconItem(t)
			}).on("mouseenter", function() {
				var e = $(this);
				e.addClass("tdou_item_hover")
			}).on("mouseleave", function() {
				var e = $(this);
				e.removeClass("tdou_item_hover")
			}), $(".j_tdou_buy_btn_big").on("click", function() {
				var t = $(".goods_wrap_selected");
				if(0 != t.length) {
					var n = $(".j_tdou_calc_input").val(),
						o = t[0].id;
					e.wrap = $("#tdou_pay_icon_dialog");
					var a = $.tb.location.getHref();
					e.payChannel = 2, e._openCtrl("dialog"), e.payType = e.QIANBAO, e.viewUtil.displayLoading(e.wrap), e.dataProxy.payIcon(o, n, e.buyIcon, e, a, e.consumption_path, e.payChannel)
				}
			}), this.buildStatsEvent()
		},
		buildStatsEvent: function() {
			$(".good_price_joinvip").find("a").on("click", function() {
				$.stats.track("T\u8c46\u94b1\u5305", "\u4f1a\u5458\u5065\u5eb7\u7edf\u8ba1", "", "click", {
					obj_name: "\u83b7\u53d6T\u8c46\u70b9\u51fb\u8d34\u5427\u8d85\u7ea7\u4f1a\u5458"
				})
			})
		},
		_openCtrl: function(e) {
			var t = this,
				n = t.openType;
			switch(e = "win" === e || "dialog" === e ? e : n) {
				case "win":
					t.openNewWindow();
					break;
				case "dialog":
			}
		},
		openNewWindow: function() {
			this.win = window.open("")
		},
		bindCounterEvent: function() {
			var e = this;
			$(".tdou_calc_count_wrap").each(function() {
				e.counter.bindEvents($(this).find(".j_tdou_calc_count")), e.counter.onValueChange.push({
					action: e.onCounterValueChange,
					context: e
				})
			})
		},
		closeMain: function() {
			this._dialog.close(), this.dataProxy.clearCache()
		},
		selectIconItem: function(e) {
			if(e) {
				$(".j_tdou_get_item").removeClass("goods_wrap_selected"), e.addClass("goods_wrap_selected");
				var t = this,
					n = e.tbattr("id");
				$(".j_tdou_counter_replace").html(t.counter.builderUI(n));
				var o = $("#tdou_counter_" + n);
				t.counter.bindEvents(o), t.counter.onValueChange.push({
					action: t.onCounterValueChange,
					context: t
				}), t.onCounterValueChange(1, n)
			}
		},
		onCounterValueChange: function(e, t) {
			var n = this.dataProxy.getPriceInfo(e, t),
				o = this.dataProxy.getMemberLevel();
			$(".j_goods_member_num").html(o > 1 ? n.member_price : n.non_member_price), $(".j_goods_tmall_price_num").html(n.tbmall_price)
		},
		buyIcon: function(e) {
			var t = this;
			if(t.viewUtil.hideLoading(), t.wrap = $("#tdou_pay_icon_dialog"), t.tbs = PageData.tbs, e && 0 === e.no)
				if(t.win) t.checkTdou.showTdouCheckView(t.wrap, t.updateTdou, t), t.win.location.href = e.data;
				else {
					t.cashier = t.requireInstance("encourage-payment/widget/qianbao_purchase_tdou");
					var n = e.data,
						o = $.extend({
							product: "tdou",
							consumption_path: t.consumption_path,
							goods_cost_tdou: t.current_need_tdou,
							pay_type: 6,
							pay_channel: t.payChannel
						}, {
							qianbao_params: n.return_url,
							iconCount: n.iconCount,
							iconId: n.iconId
						}),
						a = {
							ie: "utf-8",
							tbs: t.tbs,
							terminal: "pc",
							pay_type: 6,
							iconId: n.iconId,
							pageUrl: n.return_url || "",
							margin: t.current_need_tdou,
							goodsCost: t.current_need_tdou,
							fr: t.consumption_path || 0,
							channel: t.payChannel
						};
					t.cashier.showDialog(o, a)
				}
			else if(e && 11e4 === e.no) t.closeMain(), t.viewUtil.OpenLoginDialog(), t.win && t.win.close();
			else if(e && 1990055 === e.error_code)
				if("undefined" == typeof passport || "undefined" == typeof passport.pop.init) {
					var i = "undefined" != typeof Env && Env.server_time ? Env.server_time : (new Date).getTime(),
						r = "https://passport";
					$.JsLoadManager.use([r + ".baidu.com/passApi/js/uni_login_wrapper.js?cdnversion=" + Math.floor(i / 6e4), r + ".baidu.com/passApi/js/wrapper.js?cdnversion=" + Math.floor(i / 6e4)], function() {
						window.realname = passport.pop.init({
							type: "accRealName",
							apiOpt: {
								product: "tb",
								staticPage: "//tieba.baidu.com/tb/static-common/html/pass/v3Jump.html"
							},
							tangram: !0,
							color: "green"
						}), window.realname.show()
					}, !0, "utf-8")
				} else window.realname.show();
			else this.viewUtil.displayErrorInfo(t.wrap, ""), t.win && t.win.close()
		},
		updateTdou: function() {
			var e = this;
			e.dataProxy.getTdou(e.onUpdateTdou, e)
		},
		onUpdateTdou: function(e) {
			var t = this;
			if(e && 0 === e.no) {
				var n = e.data.Parr_scores,
					o = $("#tdou_remain_num"),
					a = n ? n.scores_money + n.scores_other : 0,
					i = t.dataProxy.getUserTdou();
				if(o.val(a), a - i >= 1e4) {
					t.wrap = $("#tdou_pay_icon_dialog");
					var r = t.dataProxy.getUserName();
					this.viewUtil.dispalySuccessedInfo(t.wrap, r, function() {
						t.trigger("after_buy_icon", n), t.closeMain()
					}, t)
				} else this.viewUtil.displayErrorInfo(t.wrap, "", function() {
					t.trigger("after_buy_icon", n), t.closeMain()
				}, t)
			}
		},
		addUmoney: function() {
			var e = this;
			e.umoney = e.requireInstance("encourage-payment/widget/umoney_query");
			var t = e.umoney.showUmoneyOnGotTdou();
			e._dialog.element.find(".j_tdou_umoney").append(t)
		},
		isQianbaoHitSmallFlow: function() {
			var e = PageData && PageData.user && PageData.user.id;
			return e ? "1157380926" == e || "707573940" == e || "963463500" == e || "1093896819" == e || "1496" == e || "1134652730" == e || "982451133" == e ? !0 : (e = parseInt(e), e % 1 === 0) : !1
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tdou",
	requires: ["encourage-payment/widget/tdou_view", "encourage-payment/widget/tdou_view_auto_redirect"],
	sub: {
		initial: function(e) {
			e = $.extend({
				scores: {
					level: 2,
					limit: 8e3,
					scores_fetch: 0,
					scores_money: 534,
					scores_other: 80,
					scores_total: 614,
					update_time: 1432008154
				},
				level: {
					end_time: "1421055636",
					expired_notify: 1,
					expiring_notify: 1,
					left_num: 0,
					max_free_score: 8e3,
					open_status: null,
					props_category: 105,
					props_id: 2,
					props_type: 0,
					update_time: null,
					used_status: 1
				}
			}, e);
			var t = e.scores,
				o = e.level;
			this.view = this.requireInstance("encourage-payment/widget/tdou_view", {
				scores: t,
				level: o
			}), this.autoDirect = this.requireInstance("encourage-payment/widget/tdou_view_auto_redirect")
		},
		factory: function(e, t) {
			var o = "",
				i = "",
				r = 0;
			switch(e) {
				case "get_icon":
					o = t.consumption_path, i = t.desc, r = t.current_need_tdou, this.view.createMain(o, i, r);
					break;
				case "auto_direct":
					var s = {
						consumption_path: t.consumption_path,
						title: t.desc,
						need_tdou: t.current_need_tdou,
						goods_cost_tdou: t.goods_cost_tdou || 0,
						pay_type: t.pay_type,
						tbs: t.tbs,
						order_id: t.order_id,
						is_dialog: t.is_iframe
					};
					this.autoDirect.createMain(s);
					break;
				case "payment":
			}
		}
	}
});
_.Module.define({
	path: "encourage-payment/widget/tcharge_dialog",
	requires: ["encourage-payment/widget/tdou", "encourage-payment/widget/tdou_get"],
	sub: {
		initial: function(e) {
			var t = this;
			e = $.extend({}, e);
			var r = t.requireInstance("encourage-payment/widget/tdou", [{
				scores: e.scores,
				level: e.level
			}]);
			e && e.chargeType && "platform" == e.chargeType ? r.factory("payment", e) : (e && (t.consumption_path = e.consumption_path, t.desc = e.desc, t.current_need_tdou = e.current_need_tdou, t.is_direct_cashier = e.is_direct_cashier), e && t.is_direct_cashier ? r.factory("auto_direct", e) : t.requireInstance("encourage-payment/widget/tdou_get", e))
		}
	}
});